2022-08-08 10:42:08 +02:00
|
|
|
import { Job } from 'bullmq'
|
2020-01-10 10:11:28 +01:00
|
|
|
import { VideosRedundancyScheduler } from '@server/lib/schedulers/videos-redundancy-scheduler'
|
2020-04-23 09:32:53 +02:00
|
|
|
import { VideoRedundancyPayload } from '@shared/models'
|
2021-08-27 14:32:44 +02:00
|
|
|
import { logger } from '../../../helpers/logger'
|
2020-01-10 10:11:28 +01:00
|
|
|
|
2021-08-27 14:32:44 +02:00
|
|
|
async function processVideoRedundancy (job: Job) {
|
2020-01-10 10:11:28 +01:00
|
|
|
const payload = job.data as VideoRedundancyPayload
|
2022-08-08 15:48:17 +02:00
|
|
|
logger.info('Processing video redundancy in job %s.', job.id)
|
2020-01-10 10:11:28 +01:00
|
|
|
|
|
|
|
return VideosRedundancyScheduler.Instance.createManualRedundancy(payload.videoId)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
|
|
|
processVideoRedundancy
|
|
|
|
}
|