From e94fd374266acb1531b986050ba7486b03b18250 Mon Sep 17 00:00:00 2001 From: Yanlong Wang Date: Wed, 3 Aug 2022 18:26:33 +0800 Subject: [PATCH] fix: unref setTimeout in pool As a library don't block the process quit. Simply `unref` all the `setTimeout`s. --- lib/Pool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Pool.js b/lib/Pool.js index 0a006dd..d014052 100644 --- a/lib/Pool.js +++ b/lib/Pool.js @@ -402,7 +402,7 @@ class Pool extends EventEmitter { this._scheduledEviction = setTimeout(() => { this._evict(); this._scheduleEvictorRun(); - }, this._config.evictionRunIntervalMillis); + }, this._config.evictionRunIntervalMillis).unref(); } }