aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/video-file.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-10 17:02:20 +0200
committerChocobozzz <me@florianbigard.com>2018-07-11 14:00:17 +0200
commit94831479f5facff9469540a3d49dd347b88bdf5a (patch)
tree4e8990fc4fded913952c732b6466b15fc52ab06d /server/lib/job-queue/handlers/video-file.ts
parent2cdf27bae6acfaa0b99bb07555edc57f48b8bc43 (diff)
downloadPeerTube-94831479f5facff9469540a3d49dd347b88bdf5a.tar.gz
PeerTube-94831479f5facff9469540a3d49dd347b88bdf5a.tar.zst
PeerTube-94831479f5facff9469540a3d49dd347b88bdf5a.zip
Migrate to bull
Diffstat (limited to 'server/lib/job-queue/handlers/video-file.ts')
-rw-r--r--server/lib/job-queue/handlers/video-file.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/lib/job-queue/handlers/video-file.ts b/server/lib/job-queue/handlers/video-file.ts
index fc40527c7..bd68dd78b 100644
--- a/server/lib/job-queue/handlers/video-file.ts
+++ b/server/lib/job-queue/handlers/video-file.ts
@@ -1,4 +1,4 @@
1import * as kue from 'kue' 1import * as Bull from 'bull'
2import { VideoResolution, VideoState } from '../../../../shared' 2import { VideoResolution, VideoState } from '../../../../shared'
3import { logger } from '../../../helpers/logger' 3import { logger } from '../../../helpers/logger'
4import { computeResolutionsToTranscode } from '../../../helpers/utils' 4import { computeResolutionsToTranscode } from '../../../helpers/utils'
@@ -7,6 +7,7 @@ import { JobQueue } from '../job-queue'
7import { federateVideoIfNeeded } from '../../activitypub' 7import { federateVideoIfNeeded } from '../../activitypub'
8import { retryTransactionWrapper } from '../../../helpers/database-utils' 8import { retryTransactionWrapper } from '../../../helpers/database-utils'
9import { sequelizeTypescript } from '../../../initializers' 9import { sequelizeTypescript } from '../../../initializers'
10import * as Bluebird from 'bluebird'
10 11
11export type VideoFilePayload = { 12export type VideoFilePayload = {
12 videoUUID: string 13 videoUUID: string
@@ -20,7 +21,7 @@ export type VideoFileImportPayload = {
20 filePath: string 21 filePath: string
21} 22}
22 23
23async function processVideoFileImport (job: kue.Job) { 24async function processVideoFileImport (job: Bull.Job) {
24 const payload = job.data as VideoFileImportPayload 25 const payload = job.data as VideoFileImportPayload
25 logger.info('Processing video file import in job %d.', job.id) 26 logger.info('Processing video file import in job %d.', job.id)
26 27
@@ -37,7 +38,7 @@ async function processVideoFileImport (job: kue.Job) {
37 return video 38 return video
38} 39}
39 40
40async function processVideoFile (job: kue.Job) { 41async function processVideoFile (job: Bull.Job) {
41 const payload = job.data as VideoFilePayload 42 const payload = job.data as VideoFilePayload
42 logger.info('Processing video file in job %d.', job.id) 43 logger.info('Processing video file in job %d.', job.id)
43 44
@@ -109,7 +110,7 @@ async function onVideoFileOptimizerSuccess (video: VideoModel, isNewVideo: boole
109 ) 110 )
110 111
111 if (resolutionsEnabled.length !== 0) { 112 if (resolutionsEnabled.length !== 0) {
112 const tasks: Promise<any>[] = [] 113 const tasks: Bluebird<any>[] = []
113 114
114 for (const resolution of resolutionsEnabled) { 115 for (const resolution of resolutionsEnabled) {
115 const dataInput = { 116 const dataInput = {