diff options
author | Chocobozzz <me@florianbigard.com> | 2022-09-28 10:03:06 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-09-28 10:03:06 +0200 |
commit | 690bad52e186a0111359062743d9638b911026f2 (patch) | |
tree | 27f38857f2db19c5f0090c48a0c75e4b47849ef6 /server/lib/video-state.ts | |
parent | 718fc079530b82705dafb60d62f49cf62840a1a2 (diff) | |
download | PeerTube-690bad52e186a0111359062743d9638b911026f2.tar.gz PeerTube-690bad52e186a0111359062743d9638b911026f2.tar.zst PeerTube-690bad52e186a0111359062743d9638b911026f2.zip |
Prevent "Cannot use same state" error
Diffstat (limited to 'server/lib/video-state.ts')
-rw-r--r-- | server/lib/video-state.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/lib/video-state.ts b/server/lib/video-state.ts index 9ebbd7679..893725d85 100644 --- a/server/lib/video-state.ts +++ b/server/lib/video-state.ts | |||
@@ -82,7 +82,10 @@ async function moveToExternalStorageState (options: { | |||
82 | if (pendingTranscode !== 0) return false | 82 | if (pendingTranscode !== 0) return false |
83 | 83 | ||
84 | const previousVideoState = video.state | 84 | const previousVideoState = video.state |
85 | await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, isNewVideo, transaction) | 85 | |
86 | if (video.state !== VideoState.TO_MOVE_TO_EXTERNAL_STORAGE) { | ||
87 | await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, isNewVideo, transaction) | ||
88 | } | ||
86 | 89 | ||
87 | logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] }) | 90 | logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] }) |
88 | 91 | ||