PeerTube/server/core/lib/job-queue/handlers/video-redundancy.ts

18 lines
619 B
TypeScript
Raw Normal View History

2022-08-08 03:42:08 -05:00
import { Job } from 'bullmq'
import { VideosRedundancyScheduler } from '@server/lib/schedulers/videos-redundancy-scheduler.js'
import { VideoRedundancyPayload } from '@peertube/peertube-models'
import { logger } from '../../../helpers/logger.js'
2020-01-10 03:11:28 -06:00
2021-08-27 07:32:44 -05:00
async function processVideoRedundancy (job: Job) {
2020-01-10 03:11:28 -06:00
const payload = job.data as VideoRedundancyPayload
2022-08-08 08:48:17 -05:00
logger.info('Processing video redundancy in job %s.', job.id)
2020-01-10 03:11:28 -06:00
return VideosRedundancyScheduler.Instance.createManualRedundancy(payload.videoId)
}
// ---------------------------------------------------------------------------
export {
processVideoRedundancy
}