1
0
Fork 0

Prevent error in update scheduler

This commit is contained in:
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

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 }