Permalink
Browse files

better DC logic on shutdown

  • Loading branch information...
1 parent 93a09b2 commit 815d15299c1f8362e7740efbfbf2c3f86a1863b9 @evantahler committed Mar 5, 2013
Showing with 8 additions and 3 deletions.
  1. +1 −0 actionHero.js
  2. +5 −0 initializers/faye.js
  3. +2 −3 initializers/webServer.js
View
1 actionHero.js
@@ -141,6 +141,7 @@ actionHero.prototype.stop = function(next){
var orderedTeardowns = {};
var thing = [
"webServer",
+ "faye",
"webSocketServer",
"socketServer",
"taskProcessor"
View
5 initializers/faye.js
@@ -40,6 +40,11 @@ var faye = function(api, next){
next();
}
+ api.faye._teardown = function(api, next){
+ api.faye.server.getClient().disconnect();
+ next();
+ }
+
api.faye.connectHandlers.push(function(clientId){
api.log("faye client connected: " + clientId, "debug");
});
View
5 initializers/webServer.js
@@ -46,9 +46,8 @@ var webServer = function(api, next){
}
}
}
- if(api.configData.webSockets.enable != true){
- api.webServer.server.close();
- }
+
+ api.webServer.server.close();
next();
}

0 comments on commit 815d152

Please sign in to comment.