Prevent "Cannot use same state" error
This commit is contained in:
parent
718fc07953
commit
690bad52e1
|
@ -82,7 +82,10 @@ async function moveToExternalStorageState (options: {
|
||||||
if (pendingTranscode !== 0) return false
|
if (pendingTranscode !== 0) return false
|
||||||
|
|
||||||
const previousVideoState = video.state
|
const previousVideoState = video.state
|
||||||
await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, isNewVideo, transaction)
|
|
||||||
|
if (video.state !== VideoState.TO_MOVE_TO_EXTERNAL_STORAGE) {
|
||||||
|
await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, isNewVideo, transaction)
|
||||||
|
}
|
||||||
|
|
||||||
logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] })
|
logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] })
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue