mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Remove deprecated scheduler
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user