summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-06-17 16:32:33 +0800
committerCheng-Han, Wu2016-06-17 16:32:33 +0800
commit614a97376dff04d06dae682a079da0ad3a6af76f (patch)
tree9b07da3e1d491eae1f7d39cf51d19fc61420bd4d /lib
parent6fddab1bfc1db52bfe5a8bb1cfbf250920571c50 (diff)
Try to solve realtime connection get stock when lots of client try to connect at same moment
Diffstat (limited to '')
-rw-r--r--lib/realtime.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/realtime.js b/lib/realtime.js
index 8ed54437..5de3c565 100644
--- a/lib/realtime.js
+++ b/lib/realtime.js
@@ -329,7 +329,11 @@ var isDisconnectBusy = false;
var disconnectSocketQueue = [];
function finishConnection(socket, note, user) {
- if (!socket || !note || !user) return;
+ if (!socket || !note || !user) {
+ connectionSocketQueue.pop();
+ isConnectionBusy = false;
+ return;
+ }
//check view permission
if (note.permission == 'private') {
if (socket.request.user && socket.request.user.logged_in && socket.request.user.id == note.owner) {