summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2016-10-21 13:35:29 +0800
committerWu Cheng-Han2016-10-21 13:35:29 +0800
commit209534993addb8e8c369e2ec9539e0f9439b474b (patch)
tree36fdc668d63d8e4d76ff3fa36cadc9ef77604dcf
parentdadcabced110deb6beee9366ddce8d9d0d2f67f3 (diff)
Fix socket disconnect might interrupt loop issue
-rw-r--r--app.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app.js b/app.js
index c0c554c4..9e4d54e7 100644
--- a/app.js
+++ b/app.js
@@ -506,7 +506,9 @@ process.on('SIGINT', function () {
var socket = io.sockets.sockets[key];
// notify client server going into maintenance status
socket.emit('maintenance');
- socket.disconnect(true);
+ setTimeout(function () {
+ socket.disconnect(true);
+ }, 0);
});
var checkCleanTimer = setInterval(function () {
if (history.isReady() && realtime.isReady()) {