From 209534993addb8e8c369e2ec9539e0f9439b474b Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Fri, 21 Oct 2016 13:35:29 +0800 Subject: Fix socket disconnect might interrupt loop issue --- app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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()) { -- cgit v1.2.3