diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/live/shared/muxing-session.ts | 11 |
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) { |