mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[server] unpipe from the destination, prevent leaking listeners
This commit is contained in:
parent
79b1b0f151
commit
7a3784898a
1 changed files with 6 additions and 5 deletions
|
@ -21,12 +21,13 @@ module.exports = class KbnLogger {
|
|||
}
|
||||
|
||||
init(readstream, emitter, callback) {
|
||||
readstream
|
||||
.pipe(this.squeeze)
|
||||
.pipe(this.format)
|
||||
.pipe(this.dest);
|
||||
|
||||
emitter.on('stop', _.noop);
|
||||
this.output = readstream.pipe(this.squeeze).pipe(this.format);
|
||||
this.output.pipe(this.dest);
|
||||
|
||||
emitter.on('stop', () => {
|
||||
this.output.unpipe(this.dest);
|
||||
});
|
||||
|
||||
callback();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue