Permalink
Browse files

Workaround for missing functionality on Windows.

  • Loading branch information...
1 parent 76474df commit c69d9c14e8c3c475592224139005347d42b10844 @iangreenleaf iangreenleaf committed Jun 5, 2012
Showing with 15 additions and 10 deletions.
  1. +15 −10 lib/supervisor.js
View
@@ -61,17 +61,22 @@ function run (args) {
executor = (programExt === "coffee") ? "coffee" : "node";
}
- // Pass kill signals through to child
- [ "SIGTERM", "SIGINT", "SIGHUP", "SIGQUIT" ].forEach( function(signal) {
- process.on(signal, function () {
- var child = exports.child;
- if (child) {
- util.debug("Sending "+signal+" to child...");
- child.kill(signal);
- }
- process.exit();
+ try {
+ // Pass kill signals through to child
+ [ "SIGTERM", "SIGINT", "SIGHUP", "SIGQUIT" ].forEach( function(signal) {
+ process.on(signal, function () {
+ var child = exports.child;
+ if (child) {
+ util.debug("Sending "+signal+" to child...");
+ child.kill(signal);
+ }
+ process.exit();
+ });
});
- });
+ } catch(e) {
+ // Windows doesn't support signals yet, so they simply don't get this handling.
+ // https://github.com/joyent/node/issues/1553
+ }
util.puts("")
util.debug("Running node-supervisor with");

0 comments on commit c69d9c1

Please sign in to comment.