diff options
Diffstat (limited to 'server/lib/job-queue/job-queue.ts')
-rw-r--r-- | server/lib/job-queue/job-queue.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index 8ff0c169e..2e14867f2 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts | |||
@@ -9,6 +9,7 @@ import { ActivitypubHttpUnicastPayload, processActivityPubHttpUnicast } from './ | |||
9 | import { EmailPayload, processEmail } from './handlers/email' | 9 | import { EmailPayload, processEmail } from './handlers/email' |
10 | import { processVideoFile, processVideoFileImport, VideoFileImportPayload, VideoFilePayload } from './handlers/video-file' | 10 | import { processVideoFile, processVideoFileImport, VideoFileImportPayload, VideoFilePayload } from './handlers/video-file' |
11 | import { ActivitypubFollowPayload, processActivityPubFollow } from './handlers/activitypub-follow' | 11 | import { ActivitypubFollowPayload, processActivityPubFollow } from './handlers/activitypub-follow' |
12 | import { processVideoImport, VideoImportPayload } from './handlers/video-import' | ||
12 | 13 | ||
13 | type CreateJobArgument = | 14 | type CreateJobArgument = |
14 | { type: 'activitypub-http-broadcast', payload: ActivitypubHttpBroadcastPayload } | | 15 | { type: 'activitypub-http-broadcast', payload: ActivitypubHttpBroadcastPayload } | |
@@ -17,7 +18,8 @@ type CreateJobArgument = | |||
17 | { type: 'activitypub-follow', payload: ActivitypubFollowPayload } | | 18 | { type: 'activitypub-follow', payload: ActivitypubFollowPayload } | |
18 | { type: 'video-file-import', payload: VideoFileImportPayload } | | 19 | { type: 'video-file-import', payload: VideoFileImportPayload } | |
19 | { type: 'video-file', payload: VideoFilePayload } | | 20 | { type: 'video-file', payload: VideoFilePayload } | |
20 | { type: 'email', payload: EmailPayload } | 21 | { type: 'email', payload: EmailPayload } | |
22 | { type: 'video-import', payload: VideoImportPayload } | ||
21 | 23 | ||
22 | const handlers: { [ id in JobType ]: (job: Bull.Job) => Promise<any>} = { | 24 | const handlers: { [ id in JobType ]: (job: Bull.Job) => Promise<any>} = { |
23 | 'activitypub-http-broadcast': processActivityPubHttpBroadcast, | 25 | 'activitypub-http-broadcast': processActivityPubHttpBroadcast, |
@@ -26,7 +28,8 @@ const handlers: { [ id in JobType ]: (job: Bull.Job) => Promise<any>} = { | |||
26 | 'activitypub-follow': processActivityPubFollow, | 28 | 'activitypub-follow': processActivityPubFollow, |
27 | 'video-file-import': processVideoFileImport, | 29 | 'video-file-import': processVideoFileImport, |
28 | 'video-file': processVideoFile, | 30 | 'video-file': processVideoFile, |
29 | 'email': processEmail | 31 | 'email': processEmail, |
32 | 'video-import': processVideoImport | ||
30 | } | 33 | } |
31 | 34 | ||
32 | const jobsWithRequestTimeout: { [ id in JobType ]?: boolean } = { | 35 | const jobsWithRequestTimeout: { [ id in JobType ]?: boolean } = { |
@@ -43,7 +46,8 @@ const jobTypes: JobType[] = [ | |||
43 | 'activitypub-http-unicast', | 46 | 'activitypub-http-unicast', |
44 | 'email', | 47 | 'email', |
45 | 'video-file', | 48 | 'video-file', |
46 | 'video-file-import' | 49 | 'video-file-import', |
50 | 'video-import' | ||
47 | ] | 51 | ] |
48 | 52 | ||
49 | class JobQueue { | 53 | class JobQueue { |