Remove deprecated scheduler

This commit is contained in:
Chocobozzz 2023-07-28 16:22:27 +02:00
parent b203a25e1f
commit ce8d0b5aae
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 1 additions and 31 deletions

View File

@ -123,7 +123,6 @@ import { apiFailMiddleware } from './server/middlewares/error'
import { Redis } from './server/lib/redis'
import { ActorFollowScheduler } from './server/lib/schedulers/actor-follow-scheduler'
import { RemoveOldViewsScheduler } from './server/lib/schedulers/remove-old-views-scheduler'
import { RemoveOldJobsScheduler } from './server/lib/schedulers/remove-old-jobs-scheduler'
import { UpdateVideosScheduler } from './server/lib/schedulers/update-videos-scheduler'
import { YoutubeDlUpdateScheduler } from './server/lib/schedulers/youtube-dl-update-scheduler'
import { VideosRedundancyScheduler } from './server/lib/schedulers/videos-redundancy-scheduler'
@ -310,7 +309,6 @@ async function startApplication () {
// Enable Schedulers
ActorFollowScheduler.Instance.enable()
RemoveOldJobsScheduler.Instance.enable()
UpdateVideosScheduler.Instance.enable()
YoutubeDlUpdateScheduler.Instance.enable()
VideosRedundancyScheduler.Instance.enable()

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())
}
}