why-is-node-running
Advanced tools
Comparing version 2.1.0 to 2.1.1
13
index.js
@@ -9,7 +9,7 @@ var asyncHooks = require('async_hooks') | ||
var hook = asyncHooks.createHook({ | ||
init (asyncId, type) { | ||
init (asyncId, type, triggerAsyncId, resource) { | ||
if (type === 'TIMERWRAP' || type === 'PROMISE') return | ||
var err = new Error('whatevs') | ||
var stacks = stackback(err) | ||
active.set(asyncId, {type, stacks}) | ||
active.set(asyncId, {type, stacks, resource}) | ||
}, | ||
@@ -28,5 +28,10 @@ destroy (asyncId) { | ||
hook.disable() | ||
logger.error('There are %d handle(s) keeping the process running', active.size) | ||
for (const o of active.values()) printStacks(o) | ||
var activeResources = [...active.values()].filter(function(r) { | ||
if (r.type === 'Timeout' && !r.resource.hasRef()) return false | ||
return true | ||
}) | ||
logger.error('There are %d handle(s) keeping the process running', activeResources.length) | ||
for (const o of activeResources) printStacks(o) | ||
function printStacks (o) { | ||
@@ -33,0 +38,0 @@ var stacks = o.stacks.slice(1).filter(function (s) { |
{ | ||
"name": "why-is-node-running", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Node is running but you don't know why? why-is-node-running is here to help you.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6571
82