Skip to content

Commit

Permalink
attempt to fix haning streams issue
Browse files Browse the repository at this point in the history
  • Loading branch information
td-krzysiek authored and wbt committed May 18, 2023
1 parent f8320c1 commit 2609a55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/winston/transports/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ module.exports = class File extends TransportStream {
if (this._opening) {
return;
}
if (this._rotate) {
return;
}

// Check to see if we need to end the stream and create a new one.
if (!this._needsNewFile()) {
Expand Down Expand Up @@ -502,6 +505,7 @@ module.exports = class File extends TransportStream {
*/
_cleanupStream(stream) {
stream.removeListener('error', this._onError);
stream.destroy();

return stream;
}
Expand Down

0 comments on commit 2609a55

Please sign in to comment.