Max Listeners Exceeding issue fix

Prevent MaxListenersExceededWarning in PassThrough
This commit is contained in:
Killer069 2021-09-06 23:39:36 +05:30 committed by GitHub
commit 68073e225a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,6 +65,7 @@ export class LiveStreaming{
private cleanup(){
clearTimeout(this.timer as NodeJS.Timer)
clearTimeout(this.dash_timer as NodeJS.Timer)
this.request?.unpipe(this.stream)
this.request?.destroy()
this.dash_timer = null
this.video_url = ''
@ -134,6 +135,7 @@ export class Stream {
private cleanup(){
clearTimeout(this.timer as NodeJS.Timer)
this.request?.unpipe(this.stream)
this.request?.destroy()
this.request = null
this.timer = null
@ -178,6 +180,7 @@ export class Stream {
})
this.timer = setTimeout(() => {
this.request?.unpipe(this.stream)
this.loop()
}, 280 * 1000)
}