Skip to content

Commit

Permalink
Correctly detect unref'ed handles
Browse files Browse the repository at this point in the history
At this point, Timeout objects aren't the only handles that have a
hasRef() method. nodejs/node#42756 added
hasRef() to the Worker handle object that gets reported by async_hooks,
so we should consider that too.

Fixes: mafintosh#59
Signed-off-by: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
RaisinTen committed Apr 24, 2022
1 parent 24fb4c8 commit 4e1788d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e1788d

Please sign in to comment.