From 2609a55b3cd92f3ee106ea6f90eec6648c066bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Rosi=C5=84ski?= Date: Wed, 26 Apr 2023 11:50:07 +0200 Subject: [PATCH] attempt to fix haning streams issue --- lib/winston/transports/file.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/winston/transports/file.js b/lib/winston/transports/file.js index 60af7f580..c9ec1d6dc 100644 --- a/lib/winston/transports/file.js +++ b/lib/winston/transports/file.js @@ -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()) { @@ -502,6 +505,7 @@ module.exports = class File extends TransportStream { */ _cleanupStream(stream) { stream.removeListener('error', this._onError); + stream.destroy(); return stream; }