Skip to content

Commit

Permalink
0.0.11 force kill printout
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldrudell committed Sep 20, 2012
1 parent db48a42 commit 5b6caa1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions lib/childmanager.js
Expand Up @@ -49,21 +49,24 @@ function childManager(cb, stateChange) {
}

function kill() {
var t
if (child && child.pid && !didKill) {
didKill = true
pendingKill = true
stateChange('stopping')
t = Date.now()
setTimeout(sigResult, 3000)
// try the nice sigint first (ctrl-break)
process.kill(child.pid, 'SIGINT')
}
}

function sigResult() {
killTimer = null
if (pendingKill) {
// now the evil sigterm
process.kill(child.pid)
function sigResult() {
killTimer = null
if (pendingKill) {
cb('childLog', 'Force kill at: ' + (Date.now() - t) / 1e3)
// now the evil sigterm
process.kill(child.pid)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -8,7 +8,7 @@
"node",
"operations"
],
"version": "0.0.10",
"version": "0.0.11",
"contributors": [
{
"name": "Harald Rudell",
Expand Down

0 comments on commit 5b6caa1

Please sign in to comment.