fix(aibox): 缩短 WebSocket 心跳间隔并补全直连页面心跳
前置代理(Nginx/CDN)的 proxy_read_timeout 约 20s,原 25s 心跳 无法在超时前到达,导致连接被代理切断。aibox.js 心跳从 25s 缩短至 10s;frontend.html 直连页面此前完全无心跳,新增 10s 应用层心跳。
This commit is contained in:
1 parent
bcb1d5d557
commit
7ff73b7d07
2 files changed
+12
-2
No files matched your search
@@ -44,8 +44,8 @@ let ws = null;
|
||||
let manualClose = false; /* 手动断开则抑制自动重连 */
|
||||
let reconnectDelay = RECONNECT_MIN;
|
||||
let reconnectTimer = null;
|
||||
let heartbeatTimer = null; /* 心跳定时器,25s 发送 ping 保持 WS 连接 */
|
||||
const HEARTBEAT_INTERVAL = 25000; /* 心跳间隔(< gateway 30s 空闲超时) */
|
||||
let heartbeatTimer = null; /* 心跳定时器,10s 发送 ping 保持 WS 连接 */
|
||||
const HEARTBEAT_INTERVAL = 10000; /* 心跳间隔:需低于前置代理(Nginx/CDN)的 proxy_read_timeout */
|
||||
|
||||
function startHeartbeat() {
|
||||
stopHeartbeat();
|
||||
|
||||
Reference in new issue
Block a user