increase timeouts for pings
This commit is contained in:
parent
e820032a3a
commit
a9c2289d4f
|
@ -60,14 +60,14 @@ class SocketClient extends EventEmitter {
|
|||
checkHealth() {
|
||||
if (this.readyState === WebSocket.OPEN) {
|
||||
const now = Date.now();
|
||||
if (now - 14000 > this.timeLastPing) {
|
||||
if (now - 20000 > this.timeLastPing) {
|
||||
// server didn't send anything, probably dead
|
||||
console.log('Server is silent, killing websocket');
|
||||
this.readyState = WebSocket.CLOSING;
|
||||
this.ws.close();
|
||||
}
|
||||
if (now - 10000 > this.timeLastSent) {
|
||||
// make sure we send something at least all 12s
|
||||
if (now - 43000 > this.timeLastSent) {
|
||||
// make sure we send something at least all 45s
|
||||
this.sendWhenReady(Ping.dehydrate());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -368,9 +368,7 @@ class SocketServer {
|
|||
let client = it.next();
|
||||
while (!client.done) {
|
||||
const ws = client.value;
|
||||
if (ws.readyState === WebSocket.OPEN
|
||||
&& ws.user
|
||||
) {
|
||||
if (ws.readyState === WebSocket.OPEN) {
|
||||
const canvasId = ws.canvasId || 0;
|
||||
const { ip } = ws.user;
|
||||
// only count unique IPs per canvas
|
||||
|
|
Loading…
Reference in New Issue
Block a user