aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/schedulers/remove-old-jobs-scheduler.ts
blob: 51fcf711eaff66b7d68663b711006ce70f126f99 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { logger } from '../../helpers/logger'
import { JobQueue } from '../job-queue'
import { AbstractScheduler } from './abstract-scheduler'

export class RemoveOldJobsScheduler extends AbstractScheduler {

  private static instance: AbstractScheduler

  private constructor () {
    super()
  }

  async execute () {
    logger.info('Removing old jobs (scheduler).')

    JobQueue.Instance.removeOldJobs()
  }

  static get Instance () {
    return this.instance || (this.instance = new this())
  }
}