mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 19:44:59 +03:00
UBERF-6318: Fix server drop connection on connect (#5174)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
76db760ae3
commit
bef6c034a0
@ -53,7 +53,7 @@ export class ClientSession implements Session {
|
|||||||
useCompression: boolean = true
|
useCompression: boolean = true
|
||||||
useBroadcast: boolean = false
|
useBroadcast: boolean = false
|
||||||
sessionId = ''
|
sessionId = ''
|
||||||
lastRequest = 0
|
lastRequest = Date.now()
|
||||||
|
|
||||||
total: StatisticsElement = { find: 0, tx: 0 }
|
total: StatisticsElement = { find: 0, tx: 0 }
|
||||||
current: StatisticsElement = { find: 0, tx: 0 }
|
current: StatisticsElement = { find: 0, tx: 0 }
|
||||||
|
@ -144,12 +144,12 @@ class TSessionManager implements SessionManager {
|
|||||||
}
|
}
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
const diff = now - s[1].session.lastRequest
|
const diff = now - s[1].session.lastRequest
|
||||||
if (diff > 60000) {
|
if (diff > 60000 && this.ticks % 10 === 0) {
|
||||||
console.log('session hang, closing...', h[0], s[1].session.getUser())
|
console.log('session hang, closing...', h[0], s[1].session.getUser())
|
||||||
void this.close(s[1].socket, h[1].workspaceId, 1001, 'CLIENT_HANGOUT')
|
void this.close(s[1].socket, h[1].workspaceId, 1001, 'CLIENT_HANGOUT')
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (diff > 20000 && this.ticks % 10 === 0) {
|
if (diff > 20000 && diff < 60000 && this.ticks % 10 === 0) {
|
||||||
void s[1].socket.send(
|
void s[1].socket.send(
|
||||||
h[1].context,
|
h[1].context,
|
||||||
{ result: 'ping' },
|
{ result: 'ping' },
|
||||||
|
Loading…
Reference in New Issue
Block a user