Skip to content

Commit da7b6a3

Browse files
committed
Reduce realtime timeout and heartbeat interval to handle stale clients quicker
1 parent 1df5b4c commit da7b6a3

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ var sessionlife = config.sessionlife || 14 * 24 * 60 * 60 * 1000; //14 days
4949
var staticcachetime = config.staticcachetime || 1 * 24 * 60 * 60 * 1000; // 1 day
5050

5151
// socket.io
52-
var heartbeatinterval = config.heartbeatinterval || 5000;
53-
var heartbeattimeout = config.heartbeattimeout || 10000;
52+
var heartbeatinterval = config.heartbeatinterval || 1000;
53+
var heartbeattimeout = config.heartbeattimeout || 5000;
5454

5555
// document
5656
var documentmaxlength = config.documentmaxlength || 100000;

public/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ function havePermission() {
20492049
//socket.io actions
20502050
var socket = io.connect({
20512051
path: urlpath ? '/' + urlpath + '/socket.io/' : '',
2052-
timeout: 10000 //10 secs to timeout
2052+
timeout: 5000 //5 secs to timeout
20532053
});
20542054
//overwrite original event for checking login state
20552055
var on = socket.on;

0 commit comments

Comments
 (0)