From c8fdfab0e36cc7324c61710009bf334e836485d9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 25 May 2022 15:18:29 +0200 Subject: [PATCH] More robust live ending job --- server/lib/job-queue/handlers/video-live-ending.ts | 8 ++++++-- server/tests/api/live/live-socket-messages.ts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts index 79aa547ba..7607267f8 100644 --- a/server/lib/job-queue/handlers/video-live-ending.ts +++ b/server/lib/job-queue/handlers/video-live-ending.ts @@ -244,6 +244,10 @@ async function cleanupLiveAndFederate (options: { await cleanupNormalLive(video, streamingPlaylist) } - const fullVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.id) - return federateVideoIfNeeded(fullVideo, false, undefined) + try { + const fullVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.id) + return federateVideoIfNeeded(fullVideo, false, undefined) + } catch (err) { + logger.warn('Cannot federate live after cleanup', { videoId: video.id, err }) + } } diff --git a/server/tests/api/live/live-socket-messages.ts b/server/tests/api/live/live-socket-messages.ts index 7668ed5b9..1669369c0 100644 --- a/server/tests/api/live/live-socket-messages.ts +++ b/server/tests/api/live/live-socket-messages.ts @@ -18,7 +18,7 @@ import { const expect = chai.expect -describe('Test live', function () { +describe('Test live socket messages', function () { let servers: PeerTubeServer[] = [] before(async function () { -- 2.41.0