From f741383004440ec85acc08d24085d505ace976fd Mon Sep 17 00:00:00 2001 From: Mohammed Shah Date: Sat, 5 Feb 2022 22:03:15 +0300 Subject: [PATCH] Memory leak fix: do not wait for `process.nextTick` to clear pending callbacks (#2057) * Memory leak fix: do not wait process.nextTick Addresses the memory leak identified here: https://github.com/winstonjs/winston/issues/1871#issuecomment-1025490757 * resolve linting failure --- lib/winston/logger.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/winston/logger.js b/lib/winston/logger.js index 0225183e5..febfb67f7 100644 --- a/lib/winston/logger.js +++ b/lib/winston/logger.js @@ -312,6 +312,7 @@ class Logger extends Transform { try { this.push(this.format.transform(info, this.format.options)); } finally { + this._writableState.sync = false; // eslint-disable-next-line callback-return callback(); }