diff options
author | Chocobozzz <me@florianbigard.com> | 2020-04-23 11:36:50 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-05-04 16:21:39 +0200 |
commit | e1c5503114deef954731904695cd40dccfcef555 (patch) | |
tree | 72cec4ee691a3362a7d024dc830d215a6b2c800a /server/lib/job-queue | |
parent | 8dc8a34ee8428e7657414115d1c137592efa174d (diff) | |
download | PeerTube-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.ts | 23 |
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' | |||
2 | import { | 2 | import { |
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' |
9 | import { logger } from '../../helpers/logger' | 16 | import { logger } from '../../helpers/logger' |
10 | import { Redis } from '../redis' | 17 | import { Redis } from '../redis' |
@@ -13,13 +20,13 @@ import { processActivityPubHttpBroadcast } from './handlers/activitypub-http-bro | |||
13 | import { processActivityPubHttpFetcher } from './handlers/activitypub-http-fetcher' | 20 | import { processActivityPubHttpFetcher } from './handlers/activitypub-http-fetcher' |
14 | import { processActivityPubHttpUnicast } from './handlers/activitypub-http-unicast' | 21 | import { processActivityPubHttpUnicast } from './handlers/activitypub-http-unicast' |
15 | import { processEmail } from './handlers/email' | 22 | import { processEmail } from './handlers/email' |
16 | import { processVideoTranscoding} from './handlers/video-transcoding' | 23 | import { processVideoTranscoding } from './handlers/video-transcoding' |
17 | import { processActivityPubFollow } from './handlers/activitypub-follow' | 24 | import { processActivityPubFollow } from './handlers/activitypub-follow' |
18 | import { processVideoImport} from './handlers/video-import' | 25 | import { processVideoImport } from './handlers/video-import' |
19 | import { processVideosViews } from './handlers/video-views' | 26 | import { processVideosViews } from './handlers/video-views' |
20 | import { refreshAPObject} from './handlers/activitypub-refresher' | 27 | import { refreshAPObject } from './handlers/activitypub-refresher' |
21 | import { processVideoFileImport} from './handlers/video-file-import' | 28 | import { processVideoFileImport } from './handlers/video-file-import' |
22 | import { processVideoRedundancy} from '@server/lib/job-queue/handlers/video-redundancy' | 29 | import { processVideoRedundancy } from '@server/lib/job-queue/handlers/video-redundancy' |
23 | 30 | ||
24 | type CreateJobArgument = | 31 | type 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) { |