aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-23 11:36:50 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-05-04 16:21:39 +0200
commite1c5503114deef954731904695cd40dccfcef555 (patch)
tree72cec4ee691a3362a7d024dc830d215a6b2c800a /server/lib/job-queue
parent8dc8a34ee8428e7657414115d1c137592efa174d (diff)
downloadPeerTube-e1c5503114deef954731904695cd40dccfcef555.tar.gz
PeerTube-e1c5503114deef954731904695cd40dccfcef555.tar.zst
PeerTube-e1c5503114deef954731904695cd40dccfcef555.zip
Support logout and add id and pass tests
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r--server/lib/job-queue/job-queue.ts23
1 files changed, 15 insertions, 8 deletions
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts
index d8d64caaf..14e181835 100644
--- a/server/lib/job-queue/job-queue.ts
+++ b/server/lib/job-queue/job-queue.ts
@@ -2,9 +2,16 @@ import * as Bull from 'bull'
2import { 2import {
3 ActivitypubFollowPayload, 3 ActivitypubFollowPayload,
4 ActivitypubHttpBroadcastPayload, 4 ActivitypubHttpBroadcastPayload,
5 ActivitypubHttpFetcherPayload, ActivitypubHttpUnicastPayload, EmailPayload, 5 ActivitypubHttpFetcherPayload,
6 ActivitypubHttpUnicastPayload,
7 EmailPayload,
6 JobState, 8 JobState,
7 JobType, RefreshPayload, VideoFileImportPayload, VideoImportPayload, VideoRedundancyPayload, VideoTranscodingPayload 9 JobType,
10 RefreshPayload,
11 VideoFileImportPayload,
12 VideoImportPayload,
13 VideoRedundancyPayload,
14 VideoTranscodingPayload
8} from '../../../shared/models' 15} from '../../../shared/models'
9import { logger } from '../../helpers/logger' 16import { logger } from '../../helpers/logger'
10import { Redis } from '../redis' 17import { Redis } from '../redis'
@@ -13,13 +20,13 @@ import { processActivityPubHttpBroadcast } from './handlers/activitypub-http-bro
13import { processActivityPubHttpFetcher } from './handlers/activitypub-http-fetcher' 20import { processActivityPubHttpFetcher } from './handlers/activitypub-http-fetcher'
14import { processActivityPubHttpUnicast } from './handlers/activitypub-http-unicast' 21import { processActivityPubHttpUnicast } from './handlers/activitypub-http-unicast'
15import { processEmail } from './handlers/email' 22import { processEmail } from './handlers/email'
16import { processVideoTranscoding} from './handlers/video-transcoding' 23import { processVideoTranscoding } from './handlers/video-transcoding'
17import { processActivityPubFollow } from './handlers/activitypub-follow' 24import { processActivityPubFollow } from './handlers/activitypub-follow'
18import { processVideoImport} from './handlers/video-import' 25import { processVideoImport } from './handlers/video-import'
19import { processVideosViews } from './handlers/video-views' 26import { processVideosViews } from './handlers/video-views'
20import { refreshAPObject} from './handlers/activitypub-refresher' 27import { refreshAPObject } from './handlers/activitypub-refresher'
21import { processVideoFileImport} from './handlers/video-file-import' 28import { processVideoFileImport } from './handlers/video-file-import'
22import { processVideoRedundancy} from '@server/lib/job-queue/handlers/video-redundancy' 29import { processVideoRedundancy } from '@server/lib/job-queue/handlers/video-redundancy'
23 30
24type CreateJobArgument = 31type CreateJobArgument =
25 { type: 'activitypub-http-broadcast', payload: ActivitypubHttpBroadcastPayload } | 32 { type: 'activitypub-http-broadcast', payload: ActivitypubHttpBroadcastPayload } |
@@ -117,7 +124,7 @@ class JobQueue {
117 124
118 createJob (obj: CreateJobArgument): void { 125 createJob (obj: CreateJobArgument): void {
119 this.createJobWithPromise(obj) 126 this.createJobWithPromise(obj)
120 .catch(err => logger.error('Cannot create job.', { err, obj })) 127 .catch(err => logger.error('Cannot create job.', { err, obj }))
121 } 128 }
122 129
123 createJobWithPromise (obj: CreateJobArgument) { 130 createJobWithPromise (obj: CreateJobArgument) {