diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-12 17:13:32 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-12 17:13:32 +0100 |
commit | 501af82d999a79e277f87794f6296d0e3495775c (patch) | |
tree | 1ba78d7c59446176d0ebf5a5bfb86c54859d09f1 /server/lib/live-manager.ts | |
parent | 2122606318bf208262d1573ab8d9a772cd697448 (diff) | |
download | PeerTube-501af82d999a79e277f87794f6296d0e3495775c.tar.gz PeerTube-501af82d999a79e277f87794f6296d0e3495775c.tar.zst PeerTube-501af82d999a79e277f87794f6296d0e3495775c.zip |
Delay notification when waiting for a live
Diffstat (limited to 'server/lib/live-manager.ts')
-rw-r--r-- | server/lib/live-manager.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/lib/live-manager.ts b/server/lib/live-manager.ts index 60ef30d15..d1a0cee91 100644 --- a/server/lib/live-manager.ts +++ b/server/lib/live-manager.ts | |||
@@ -323,11 +323,15 @@ class LiveManager { | |||
323 | await video.save() | 323 | await video.save() |
324 | videoLive.Video = video | 324 | videoLive.Video = video |
325 | 325 | ||
326 | await federateVideoIfNeeded(video, false) | 326 | setTimeout(() => { |
327 | federateVideoIfNeeded(video, false) | ||
328 | .catch(err => logger.error('Cannot federate live video %s.', video.url, { err })) | ||
329 | |||
330 | PeerTubeSocket.Instance.sendVideoLiveNewState(video) | ||
331 | }, VIDEO_LIVE.SEGMENT_TIME_SECONDS * 1000 * VIDEO_LIVE.EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION) | ||
327 | 332 | ||
328 | PeerTubeSocket.Instance.sendVideoLiveNewState(video) | ||
329 | } catch (err) { | 333 | } catch (err) { |
330 | logger.error('Cannot federate video %d.', videoLive.videoId, { err }) | 334 | logger.error('Cannot save/federate live video %d.', videoLive.videoId, { err }) |
331 | } finally { | 335 | } finally { |
332 | masterWatcher.close() | 336 | masterWatcher.close() |
333 | .catch(err => logger.error('Cannot close master watcher of %s.', outPath, { err })) | 337 | .catch(err => logger.error('Cannot close master watcher of %s.', outPath, { err })) |