aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/lib/jobs/transcoding-job-scheduler/transcoding-job-scheduler.ts
blob: e5530a73c083f4dae99cbd21219668c881f442ac (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                                                
                                                        
                                                           
 

                                                                      
 



                              
                                                                                                 







                                                                          
                        

                         
import { JobCategory } from '../../../../shared'
import { VideoModel } from '../../../models/video/video'
import { JobHandler, JobScheduler } from '../job-scheduler'

import * as videoFileOptimizer from './video-file-optimizer-handler'
import * as videoFileTranscoder from './video-file-transcoder-handler'

type TranscodingJobPayload = {
  videoUUID: string
  resolution?: number
}
const jobHandlers: { [ handlerName: string ]: JobHandler<TranscodingJobPayload, VideoModel> } = {
  videoFileOptimizer,
  videoFileTranscoder
}
const jobCategory: JobCategory = 'transcoding'

const transcodingJobScheduler = new JobScheduler(jobCategory, jobHandlers)

export {
  TranscodingJobPayload,
  transcodingJobScheduler
}