aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/live/shared/muxing-session.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-13 15:37:36 +0200
committerChocobozzz <me@florianbigard.com>2022-07-13 15:37:36 +0200
commit293992563943e6791a798f4f5b31f04773684ed7 (patch)
tree6f120fbb1a5b2fbd1263def86aa903ea0fd86147 /server/lib/live/shared/muxing-session.ts
parentba2684ceddf9b76312635b9cddc6bf6975ce436a (diff)
downloadPeerTube-293992563943e6791a798f4f5b31f04773684ed7.tar.gz
PeerTube-293992563943e6791a798f4f5b31f04773684ed7.tar.zst
PeerTube-293992563943e6791a798f4f5b31f04773684ed7.zip
Fix live tests
Diffstat (limited to 'server/lib/live/shared/muxing-session.ts')
-rw-r--r--server/lib/live/shared/muxing-session.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/server/lib/live/shared/muxing-session.ts b/server/lib/live/shared/muxing-session.ts
index 036d9d142..55d070c96 100644
--- a/server/lib/live/shared/muxing-session.ts
+++ b/server/lib/live/shared/muxing-session.ts
@@ -249,8 +249,6 @@ class MuxingSession extends EventEmitter {
249 const playlistIdMatcher = /^([\d+])-/ 249 const playlistIdMatcher = /^([\d+])-/
250 250
251 const addHandler = async (segmentPath: string) => { 251 const addHandler = async (segmentPath: string) => {
252 if (this.aborted) return
253
254 logger.debug('Live add handler of %s.', segmentPath, this.lTags()) 252 logger.debug('Live add handler of %s.', segmentPath, this.lTags())
255 253
256 const playlistId = basename(segmentPath).match(playlistIdMatcher)[0] 254 const playlistId = basename(segmentPath).match(playlistIdMatcher)[0]
@@ -285,6 +283,7 @@ class MuxingSession extends EventEmitter {
285 283
286 private async isQuotaExceeded (segmentPath: string) { 284 private async isQuotaExceeded (segmentPath: string) {
287 if (this.saveReplay !== true) return false 285 if (this.saveReplay !== true) return false
286 if (this.aborted) return false
288 287
289 try { 288 try {
290 const segmentStat = await stat(segmentPath) 289 const segmentStat = await stat(segmentPath)
@@ -337,8 +336,6 @@ class MuxingSession extends EventEmitter {
337 } 336 }
338 337
339 private processSegments (segmentPaths: string[]) { 338 private processSegments (segmentPaths: string[]) {
340 if (this.aborted) return
341
342 mapSeries(segmentPaths, async previousSegment => { 339 mapSeries(segmentPaths, async previousSegment => {
343 // Add sha hash of previous segments, because ffmpeg should have finished generating them 340 // Add sha hash of previous segments, because ffmpeg should have finished generating them
344 await LiveSegmentShaStore.Instance.addSegmentSha(this.videoUUID, previousSegment) 341 await LiveSegmentShaStore.Instance.addSegmentSha(this.videoUUID, previousSegment)
@@ -346,7 +343,11 @@ class MuxingSession extends EventEmitter {
346 if (this.saveReplay) { 343 if (this.saveReplay) {
347 await this.addSegmentToReplay(previousSegment) 344 await this.addSegmentToReplay(previousSegment)
348 } 345 }
349 }).catch(err => logger.error('Cannot process segments', { err, ...this.lTags() })) 346 }).catch(err => {
347 if (this.aborted) return
348
349 logger.error('Cannot process segments', { err, ...this.lTags() })
350 })
350 } 351 }
351 352
352 private hasClientSocketInBadHealth (sessionId: string) { 353 private hasClientSocketInBadHealth (sessionId: string) {