Skip to content

Commit

Permalink
Fixed event subscription on close
Browse files Browse the repository at this point in the history
We should listen to 'finish' event from stream to close transport.
  • Loading branch information
z-10 committed Jul 17, 2015
1 parent 4dd10f5 commit c6d45f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/winston/transports/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ File.prototype.close = function () {
this._stream.end();
this._stream.destroySoon();

this._stream.once('drain', function () {
this._stream.once('finish', function () {
self.emit('flush');
self.emit('closed');
});
Expand Down

0 comments on commit c6d45f9

Please sign in to comment.