Prevent error in update scheduler
This commit is contained in:
parent
c08e4cfcf9
commit
eb8da03d1c
1 changed files with 5 additions and 1 deletions
|
@ -53,7 +53,7 @@ export class UpdateVideosScheduler extends AbstractScheduler {
|
|||
|
||||
const video = await sequelizeTypescript.transaction(async t => {
|
||||
const video = await VideoModel.loadFull(schedule.videoId, t)
|
||||
if (video.state === VideoState.TO_TRANSCODE) return
|
||||
if (video.state === VideoState.TO_TRANSCODE) return null
|
||||
|
||||
logger.info('Executing scheduled video update on %s.', video.uuid)
|
||||
|
||||
|
@ -74,6 +74,10 @@ export class UpdateVideosScheduler extends AbstractScheduler {
|
|||
return video
|
||||
})
|
||||
|
||||
if (!video) {
|
||||
return { video, published: false }
|
||||
}
|
||||
|
||||
await addVideoJobsAfterUpdate({ video, oldPrivacy, isNewVideo, nameChanged: false })
|
||||
|
||||
return { video, published }
|
||||
|
|
Loading…
Reference in a new issue