diff options
Diffstat (limited to 'scripts/create-move-video-storage-job.ts')
-rw-r--r-- | scripts/create-move-video-storage-job.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/create-move-video-storage-job.ts b/scripts/create-move-video-storage-job.ts index c402115f0..8537114eb 100644 --- a/scripts/create-move-video-storage-job.ts +++ b/scripts/create-move-video-storage-job.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { program } from 'commander' | 1 | import { program } from 'commander' |
2 | import { toCompleteUUID } from '@server/helpers/custom-validators/misc' | ||
2 | import { CONFIG } from '@server/initializers/config' | 3 | import { CONFIG } from '@server/initializers/config' |
3 | import { initDatabaseModels } from '@server/initializers/database' | 4 | import { initDatabaseModels } from '@server/initializers/database' |
4 | import { JobQueue } from '@server/lib/job-queue' | 5 | import { JobQueue } from '@server/lib/job-queue' |
@@ -32,7 +33,10 @@ if (options['toObjectStorage'] && !CONFIG.OBJECT_STORAGE.ENABLED) { | |||
32 | 33 | ||
33 | run() | 34 | run() |
34 | .then(() => process.exit(0)) | 35 | .then(() => process.exit(0)) |
35 | .catch(err => console.error(err)) | 36 | .catch(err => { |
37 | console.error(err) | ||
38 | process.exit(-1) | ||
39 | }) | ||
36 | 40 | ||
37 | async function run () { | 41 | async function run () { |
38 | await initDatabaseModels(true) | 42 | await initDatabaseModels(true) |
@@ -42,7 +46,7 @@ async function run () { | |||
42 | let ids: number[] = [] | 46 | let ids: number[] = [] |
43 | 47 | ||
44 | if (options['video']) { | 48 | if (options['video']) { |
45 | const video = await VideoModel.load(options['video']) | 49 | const video = await VideoModel.load(toCompleteUUID(options['video'])) |
46 | 50 | ||
47 | if (!video) { | 51 | if (!video) { |
48 | console.error('Unknown video ' + options['video']) | 52 | console.error('Unknown video ' + options['video']) |