Skip to content

Commit 2609a55

Browse files
td-krzysiekwbt
authored andcommitted
attempt to fix haning streams issue
1 parent f8320c1 commit 2609a55

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/winston/transports/file.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ module.exports = class File extends TransportStream {
159159
if (this._opening) {
160160
return;
161161
}
162+
if (this._rotate) {
163+
return;
164+
}
162165

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

506510
return stream;
507511
}

0 commit comments

Comments
 (0)