aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-23 11:09:31 +0100
committerChocobozzz <me@florianbigard.com>2021-12-23 11:13:06 +0100
commitdbd9fb44ddd880622265097bd7baf4dd71ea0861 (patch)
treeb531f861026a52bcacfdee076431c1c34d9ba78d /scripts
parent482b26231b4e39234f107b8400ef606c5f003c55 (diff)
downloadPeerTube-dbd9fb44ddd880622265097bd7baf4dd71ea0861.tar.gz
PeerTube-dbd9fb44ddd880622265097bd7baf4dd71ea0861.tar.zst
PeerTube-dbd9fb44ddd880622265097bd7baf4dd71ea0861.zip
Don't stuck state when move transcoding job failed
Diffstat (limited to 'scripts')
-rw-r--r--scripts/create-move-video-storage-job.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/create-move-video-storage-job.ts b/scripts/create-move-video-storage-job.ts
index 699487f72..90c84b1d7 100644
--- a/scripts/create-move-video-storage-job.ts
+++ b/scripts/create-move-video-storage-job.ts
@@ -4,7 +4,7 @@ registerTSPaths()
4import { program } from 'commander' 4import { program } from 'commander'
5import { VideoModel } from '@server/models/video/video' 5import { VideoModel } from '@server/models/video/video'
6import { initDatabaseModels } from '@server/initializers/database' 6import { initDatabaseModels } from '@server/initializers/database'
7import { VideoStorage } from '@shared/models' 7import { VideoState, VideoStorage } from '@shared/models'
8import { moveToExternalStorageState } from '@server/lib/video-state' 8import { moveToExternalStorageState } from '@server/lib/video-state'
9import { JobQueue } from '@server/lib/job-queue' 9import { JobQueue } from '@server/lib/job-queue'
10import { CONFIG } from '@server/initializers/config' 10import { CONFIG } from '@server/initializers/config'
@@ -62,6 +62,11 @@ async function run () {
62 process.exit(-1) 62 process.exit(-1)
63 } 63 }
64 64
65 if (video.state === VideoState.TO_MOVE_TO_EXTERNAL_STORAGE) {
66 console.error('This video is already being moved to external storage')
67 process.exit(-1)
68 }
69
65 ids.push(video.id) 70 ids.push(video.id)
66 } else { 71 } else {
67 ids = await VideoModel.listLocalIds() 72 ids = await VideoModel.listLocalIds()