Remove deprecated scheduler

This commit is contained in:
Chocobozzz
2023-07-28 16:22:27 +02:00
parent b203a25e1f
commit ce8d0b5aae
3 changed files with 1 additions and 31 deletions

View File

@@ -189,7 +189,7 @@ async function replaceLiveByReplay (options: {
await assignReplayFilesToVideo({ video: videoWithFiles, replayDirectory })
// FIXME: should not happen in this function
// Should not happen in this function, but we keep the code if in the future we can replace the permanent live by a replay
if (permanentLive) { // Remove session replay
await remove(replayDirectory)
} else { // We won't stream again in this live, we can delete the base replay directory

View File

@@ -1,28 +0,0 @@
import { isTestOrDevInstance } from '../../helpers/core-utils'
import { logger } from '../../helpers/logger'
import { SCHEDULER_INTERVALS_MS } from '../../initializers/constants'
import { JobQueue } from '../job-queue'
import { AbstractScheduler } from './abstract-scheduler'
// FIXME: delete this scheduler in a few versions (introduced in 5.0)
// We introduced job removal directly using bullmq option but we still need to delete old jobs
export class RemoveOldJobsScheduler extends AbstractScheduler {
private static instance: AbstractScheduler
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.REMOVE_OLD_JOBS
private constructor () {
super()
}
protected internalExecute () {
if (!isTestOrDevInstance()) logger.info('Removing old jobs in scheduler.')
return JobQueue.Instance.removeOldJobs()
}
static get Instance () {
return this.instance || (this.instance = new this())
}
}