From 48c2e216805c4ee4a949cb445f3f96d9bc4aa056 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Sun, 24 Apr 2022 18:17:17 +0530 Subject: [PATCH] Correctly detect unref'ed handles At this point, Timeout objects aren't the only handles that have a hasRef() method. https://github.com/nodejs/node/pull/42756 added hasRef() to the Worker handle object that gets reported by async_hooks, so we should consider that too. Fixes: https://github.com/mafintosh/why-is-node-running/issues/59 Signed-off-by: Darshan Sen --- index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/index.js b/index.js index 811a0c9..54fc473 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,6 @@ function whyIsNodeRunning (logger) { hook.disable() var activeResources = [...active.values()].filter(function(r) { if ( - r.type === 'Timeout' && typeof r.resource.hasRef === 'function' && !r.resource.hasRef() ) return false