aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-state.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/video-state.ts')
-rw-r--r--server/lib/video-state.ts7
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 @@
1import { Transaction } from 'sequelize' 1import { Transaction } from 'sequelize'
2import { retryTransactionWrapper } from '@server/helpers/database-utils'
2import { logger } from '@server/helpers/logger' 3import { logger } from '@server/helpers/logger'
3import { CONFIG } from '@server/initializers/config' 4import { CONFIG } from '@server/initializers/config'
4import { sequelizeTypescript } from '@server/initializers/database' 5import { sequelizeTypescript } from '@server/initializers/database'
@@ -7,9 +8,9 @@ import { VideoJobInfoModel } from '@server/models/video/video-job-info'
7import { MVideo, MVideoFullLight, MVideoUUID } from '@server/types/models' 8import { MVideo, MVideoFullLight, MVideoUUID } from '@server/types/models'
8import { VideoState } from '@shared/models' 9import { VideoState } from '@shared/models'
9import { federateVideoIfNeeded } from './activitypub/videos' 10import { federateVideoIfNeeded } from './activitypub/videos'
11import { JobQueue } from './job-queue'
10import { Notifier } from './notifier' 12import { Notifier } from './notifier'
11import { addMoveToObjectStorageJob } from './video' 13import { buildMoveToObjectStorageJob } from './video'
12import { retryTransactionWrapper } from '@server/helpers/database-utils'
13 14
14function buildNextVideoState (currentState?: VideoState) { 15function 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) {