]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/job-queue/handlers/video-redundancy.ts
Use worker thread to send HTTP requests
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / video-redundancy.ts
index 319d7090e755581a44325419866cc38c2689bcfd..bac99fdb79c33d0718b2caa13e93a0a68845537e 100644 (file)
@@ -1,14 +1,11 @@
-import * as Bull from 'bull'
-import { logger } from '../../../helpers/logger'
+import { Job } from 'bullmq'
 import { VideosRedundancyScheduler } from '@server/lib/schedulers/videos-redundancy-scheduler'
+import { VideoRedundancyPayload } from '@shared/models'
+import { logger } from '../../../helpers/logger'
 
-export type VideoRedundancyPayload = {
-  videoId: number
-}
-
-async function processVideoRedundancy (job: Bull.Job) {
+async function processVideoRedundancy (job: Job) {
   const payload = job.data as VideoRedundancyPayload
-  logger.info('Processing video redundancy in job %d.', job.id)
+  logger.info('Processing video redundancy in job %s.', job.id)
 
   return VideosRedundancyScheduler.Instance.createManualRedundancy(payload.videoId)
 }