]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/lib/schedulers/remove-old-jobs-scheduler.ts
Fix notification with large message
[github/Chocobozzz/PeerTube.git] / server / lib / schedulers / remove-old-jobs-scheduler.ts
CommitLineData
6fdc553a 1import { isTestInstance } from '../../helpers/core-utils'
ea99d15f 2import { logger } from '../../helpers/logger'
94a5ff8a
C
3import { JobQueue } from '../job-queue'
4import { AbstractScheduler } from './abstract-scheduler'
2baea0c7 5import { SCHEDULER_INTERVALS_MS } from '../../initializers'
94a5ff8a
C
6
7export class RemoveOldJobsScheduler extends AbstractScheduler {
8
9 private static instance: AbstractScheduler
10
2baea0c7
C
11 protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.removeOldJobs
12
94a5ff8a
C
13 private constructor () {
14 super()
15 }
16
17 async execute () {
6fdc553a 18 if (!isTestInstance()) logger.info('Removing old jobs (scheduler).')
ea99d15f 19
94a5ff8a
C
20 JobQueue.Instance.removeOldJobs()
21 }
22
23 static get Instance () {
24 return this.instance || (this.instance = new this())
25 }
26}