Comparing version 0.1.0 to 0.1.1
25
init.js
@@ -101,19 +101,24 @@ (function() { | ||
return exports.status(pidfile, function(_arg) { | ||
var n, pid; | ||
var pid, signals, tryKill; | ||
pid = _arg.pid; | ||
if (pid) { | ||
n = 0; | ||
return (function() { | ||
var signal; | ||
signal = n > 3 ? 'SIGKILL' : 'SIGTERM'; | ||
signals = ['TERM', 'INT', 'QUIT', 'KILL']; | ||
tryKill = function() { | ||
var sig; | ||
sig = "SIG" + signals[0]; | ||
try { | ||
process.kill(pid); | ||
n += 1; | ||
return setTimeout(arguments.callee, 1000); | ||
process.kill(pid, sig); | ||
if (signals.length > 1) { | ||
signals.shift(); | ||
} | ||
return setTimeout((function() { | ||
return tryKill(sig); | ||
}), 2000); | ||
} catch (e) { | ||
return fs.unlink(pidfile, function() { | ||
return cb(n > 0); | ||
return cb(signals.length < 4); | ||
}); | ||
} | ||
})(); | ||
}; | ||
return tryKill(); | ||
} else { | ||
@@ -120,0 +125,0 @@ return cb(false); |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version" : "0.1.0", | ||
"version" : "0.1.1", | ||
"licences" : [ | ||
@@ -18,0 +18,0 @@ { |
Sorry, the diff of this file is not supported yet
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
9807
167
125