Prevent error in update scheduler

pull/5386/head
Chocobozzz 2022-10-31 08:51:52 +01:00
parent c08e4cfcf9
commit eb8da03d1c
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 5 additions and 1 deletions

View File

@ -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 }