Fix socket disconnect might interrupt loop issue

This commit is contained in:
Wu Cheng-Han 2016-10-21 13:35:29 +08:00
parent dadcabced1
commit 209534993a

2
app.js
View file

@ -506,7 +506,9 @@ process.on('SIGINT', function () {
var socket = io.sockets.sockets[key]; var socket = io.sockets.sockets[key];
// notify client server going into maintenance status // notify client server going into maintenance status
socket.emit('maintenance'); socket.emit('maintenance');
setTimeout(function () {
socket.disconnect(true); socket.disconnect(true);
}, 0);
}); });
var checkCleanTimer = setInterval(function () { var checkCleanTimer = setInterval(function () {
if (history.isReady() && realtime.isReady()) { if (history.isReady() && realtime.isReady()) {