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: #59
Signed-off-by: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
RaisinTen authored and mafintosh committed Apr 26, 2022
1 parent 24fb4c8 commit 48c2e21
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 48c2e21

Please sign in to comment.