Skip to content

Commit 614a973

Browse files
committed
Try to solve realtime connection get stock when lots of client try to connect at same moment
1 parent 6fddab1 commit 614a973

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/realtime.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,11 @@ var isDisconnectBusy = false;
329329
var disconnectSocketQueue = [];
330330

331331
function finishConnection(socket, note, user) {
332-
if (!socket || !note || !user) return;
332+
if (!socket || !note || !user) {
333+
connectionSocketQueue.pop();
334+
isConnectionBusy = false;
335+
return;
336+
}
333337
//check view permission
334338
if (note.permission == 'private') {
335339
if (socket.request.user && socket.request.user.logged_in && socket.request.user.id == note.owner) {

0 commit comments

Comments
 (0)