Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Stay running after crash, wait for a fix

  • Loading branch information...
commit 96753fadfab5e62882d4ca96006407194c137863 1 parent 698502e
@zzen authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 bin/bounce
View
11 bin/bounce
@@ -54,8 +54,13 @@ function watch(source) {
if (curr.mtime.getTime() === prev.mtime.getTime()) {
return null;
}
- debug("=> Bouncing....")
- child.kill("SIGTERM")
+ if (child && child.pid) {
+ debug("=> Bouncing....")
+ child.kill("SIGTERM")
+ } else {
+ debug("=> Launching after crash....")
+ respawn();
+ }
});
};
@@ -76,7 +81,7 @@ function spawn() {
respawn()
else {
console.log('node exited with code ' + (code ? code.toString() : "null") + " and signal " + (signal ? signal.toString() : "null"));
- process.exit(0)
+ child = null;
}
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.