mirror of https://github.com/Chocobozzz/PeerTube
Prevent error in update scheduler
parent
c08e4cfcf9
commit
eb8da03d1c
|
@ -53,7 +53,7 @@ export class UpdateVideosScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
const video = await sequelizeTypescript.transaction(async t => {
|
const video = await sequelizeTypescript.transaction(async t => {
|
||||||
const video = await VideoModel.loadFull(schedule.videoId, 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)
|
logger.info('Executing scheduled video update on %s.', video.uuid)
|
||||||
|
|
||||||
|
@ -74,6 +74,10 @@ export class UpdateVideosScheduler extends AbstractScheduler {
|
||||||
return video
|
return video
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!video) {
|
||||||
|
return { video, published: false }
|
||||||
|
}
|
||||||
|
|
||||||
await addVideoJobsAfterUpdate({ video, oldPrivacy, isNewVideo, nameChanged: false })
|
await addVideoJobsAfterUpdate({ video, oldPrivacy, isNewVideo, nameChanged: false })
|
||||||
|
|
||||||
return { video, published }
|
return { video, published }
|
||||||
|
|
Loading…
Reference in New Issue