aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/schedulers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-31 08:51:52 +0100
committerChocobozzz <me@florianbigard.com>2022-10-31 08:51:52 +0100
commiteb8da03d1ca80dd143a85c006caa657488296594 (patch)
treea58e8ce051988ab27cb8a1ffa70bb8742ad0cba6 /server/lib/schedulers
parentc08e4cfcf9556f4c769edb08f46725253ccc3bc7 (diff)
downloadPeerTube-eb8da03d1ca80dd143a85c006caa657488296594.tar.gz
PeerTube-eb8da03d1ca80dd143a85c006caa657488296594.tar.zst
PeerTube-eb8da03d1ca80dd143a85c006caa657488296594.zip
Prevent error in update scheduler
Diffstat (limited to 'server/lib/schedulers')
-rw-r--r--server/lib/schedulers/update-videos-scheduler.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/lib/schedulers/update-videos-scheduler.ts b/server/lib/schedulers/update-videos-scheduler.ts
index 30bf189db..e38685c04 100644
--- a/server/lib/schedulers/update-videos-scheduler.ts
+++ b/server/lib/schedulers/update-videos-scheduler.ts
@@ -53,7 +53,7 @@ export class UpdateVideosScheduler extends AbstractScheduler {
53 53
54 const video = await sequelizeTypescript.transaction(async t => { 54 const video = await sequelizeTypescript.transaction(async t => {
55 const video = await VideoModel.loadFull(schedule.videoId, t) 55 const video = await VideoModel.loadFull(schedule.videoId, t)
56 if (video.state === VideoState.TO_TRANSCODE) return 56 if (video.state === VideoState.TO_TRANSCODE) return null
57 57
58 logger.info('Executing scheduled video update on %s.', video.uuid) 58 logger.info('Executing scheduled video update on %s.', video.uuid)
59 59
@@ -74,6 +74,10 @@ export class UpdateVideosScheduler extends AbstractScheduler {
74 return video 74 return video
75 }) 75 })
76 76
77 if (!video) {
78 return { video, published: false }
79 }
80
77 await addVideoJobsAfterUpdate({ video, oldPrivacy, isNewVideo, nameChanged: false }) 81 await addVideoJobsAfterUpdate({ video, oldPrivacy, isNewVideo, nameChanged: false })
78 82
79 return { video, published } 83 return { video, published }