mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 17:52:55 +00:00
Use destroy and end in apt places
This commit is contained in:
parent
cf30b1ef08
commit
2e1a28a6ee
1 changed files with 3 additions and 3 deletions
|
|
@ -59,9 +59,9 @@ class StreamDispatcher extends Writable {
|
||||||
this._pausedTime = 0;
|
this._pausedTime = 0;
|
||||||
this.count = 0;
|
this.count = 0;
|
||||||
|
|
||||||
this.on('error', this.destroy.bind(this));
|
this.on('error', err => this.destroy(err));
|
||||||
this.on('finish', () => {
|
this.on('finish', () => {
|
||||||
this.destroy.bind(this);
|
this.end.bind(this);
|
||||||
// Still emitting end for backwards compatibility, probably remove it in the future!
|
// Still emitting end for backwards compatibility, probably remove it in the future!
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
});
|
});
|
||||||
|
|
@ -73,7 +73,7 @@ class StreamDispatcher extends Writable {
|
||||||
|
|
||||||
const streamError = err => {
|
const streamError = err => {
|
||||||
this.emit('warn', err);
|
this.emit('warn', err);
|
||||||
this.destroy();
|
this.destroy(err);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.streams.ffmpeg) this.streams.ffmpeg.on('error', streamError);
|
if (this.streams.ffmpeg) this.streams.ffmpeg.on('error', streamError);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue