From da7b6a340d74878ded59c50780463ddc9a9bfabc Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 2 Jul 2016 16:15:05 +0800 Subject: Reduce realtime timeout and heartbeat interval to handle stale clients quicker --- lib/config.js | 4 ++-- public/js/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/config.js b/lib/config.js index de49b4d7..7c21601d 100644 --- a/lib/config.js +++ b/lib/config.js @@ -49,8 +49,8 @@ var sessionlife = config.sessionlife || 14 * 24 * 60 * 60 * 1000; //14 days var staticcachetime = config.staticcachetime || 1 * 24 * 60 * 60 * 1000; // 1 day // socket.io -var heartbeatinterval = config.heartbeatinterval || 5000; -var heartbeattimeout = config.heartbeattimeout || 10000; +var heartbeatinterval = config.heartbeatinterval || 1000; +var heartbeattimeout = config.heartbeattimeout || 5000; // document var documentmaxlength = config.documentmaxlength || 100000; diff --git a/public/js/index.js b/public/js/index.js index 38882949..25bb6a99 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2049,7 +2049,7 @@ function havePermission() { //socket.io actions var socket = io.connect({ path: urlpath ? '/' + urlpath + '/socket.io/' : '', - timeout: 10000 //10 secs to timeout + timeout: 5000 //5 secs to timeout }); //overwrite original event for checking login state var on = socket.on; -- cgit v1.2.3