diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-23 11:09:31 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-23 11:13:06 +0100 |
commit | dbd9fb44ddd880622265097bd7baf4dd71ea0861 (patch) | |
tree | b531f861026a52bcacfdee076431c1c34d9ba78d /scripts/create-move-video-storage-job.ts | |
parent | 482b26231b4e39234f107b8400ef606c5f003c55 (diff) | |
download | PeerTube-dbd9fb44ddd880622265097bd7baf4dd71ea0861.tar.gz PeerTube-dbd9fb44ddd880622265097bd7baf4dd71ea0861.tar.zst PeerTube-dbd9fb44ddd880622265097bd7baf4dd71ea0861.zip |
Don't stuck state when move transcoding job failed
Diffstat (limited to 'scripts/create-move-video-storage-job.ts')
-rw-r--r-- | scripts/create-move-video-storage-job.ts | 7 |
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() | |||
4 | import { program } from 'commander' | 4 | import { program } from 'commander' |
5 | import { VideoModel } from '@server/models/video/video' | 5 | import { VideoModel } from '@server/models/video/video' |
6 | import { initDatabaseModels } from '@server/initializers/database' | 6 | import { initDatabaseModels } from '@server/initializers/database' |
7 | import { VideoStorage } from '@shared/models' | 7 | import { VideoState, VideoStorage } from '@shared/models' |
8 | import { moveToExternalStorageState } from '@server/lib/video-state' | 8 | import { moveToExternalStorageState } from '@server/lib/video-state' |
9 | import { JobQueue } from '@server/lib/job-queue' | 9 | import { JobQueue } from '@server/lib/job-queue' |
10 | import { CONFIG } from '@server/initializers/config' | 10 | import { 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() |