diff options
Diffstat (limited to 'server/lib/video-state.ts')
-rw-r--r-- | server/lib/video-state.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/lib/video-state.ts b/server/lib/video-state.ts index b5d8353b7..9ebbd7679 100644 --- a/server/lib/video-state.ts +++ b/server/lib/video-state.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { Transaction } from 'sequelize' | 1 | import { Transaction } from 'sequelize' |
2 | import { retryTransactionWrapper } from '@server/helpers/database-utils' | ||
2 | import { logger } from '@server/helpers/logger' | 3 | import { logger } from '@server/helpers/logger' |
3 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
4 | import { sequelizeTypescript } from '@server/initializers/database' | 5 | import { sequelizeTypescript } from '@server/initializers/database' |
@@ -7,9 +8,9 @@ import { VideoJobInfoModel } from '@server/models/video/video-job-info' | |||
7 | import { MVideo, MVideoFullLight, MVideoUUID } from '@server/types/models' | 8 | import { MVideo, MVideoFullLight, MVideoUUID } from '@server/types/models' |
8 | import { VideoState } from '@shared/models' | 9 | import { VideoState } from '@shared/models' |
9 | import { federateVideoIfNeeded } from './activitypub/videos' | 10 | import { federateVideoIfNeeded } from './activitypub/videos' |
11 | import { JobQueue } from './job-queue' | ||
10 | import { Notifier } from './notifier' | 12 | import { Notifier } from './notifier' |
11 | import { addMoveToObjectStorageJob } from './video' | 13 | import { buildMoveToObjectStorageJob } from './video' |
12 | import { retryTransactionWrapper } from '@server/helpers/database-utils' | ||
13 | 14 | ||
14 | function buildNextVideoState (currentState?: VideoState) { | 15 | function buildNextVideoState (currentState?: VideoState) { |
15 | if (currentState === VideoState.PUBLISHED) { | 16 | if (currentState === VideoState.PUBLISHED) { |
@@ -86,7 +87,7 @@ async function moveToExternalStorageState (options: { | |||
86 | logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] }) | 87 | logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] }) |
87 | 88 | ||
88 | try { | 89 | try { |
89 | await addMoveToObjectStorageJob({ video, previousVideoState, isNewVideo }) | 90 | await JobQueue.Instance.createJob(await buildMoveToObjectStorageJob({ video, previousVideoState, isNewVideo })) |
90 | 91 | ||
91 | return true | 92 | return true |
92 | } catch (err) { | 93 | } catch (err) { |