feat(apis/websocket): clear old client sessions and instances

This commit is contained in:
PalmDevs
2024-07-14 00:24:32 +07:00
parent 2f03800c61
commit 43bd0a021c
5 changed files with 97 additions and 79 deletions

View File

@@ -26,10 +26,14 @@ enum DisconnectReason {
* The receiving end didn't have an open socket
*/
NoOpenSocket = 4003,
/**
* The client connected from another location
*/
NewConnection = 4004,
/**
* The client was not ready in time (**CLIENT-ONLY**)
*/
TooSlow = 4002,
TooSlow = 4012,
}
export default DisconnectReason

View File

@@ -12,6 +12,7 @@ const HumanizedDisconnectReason = {
[DisconnectReason.TooSlow]: 'the client was not ready in time',
[DisconnectReason.PlannedDisconnect]: 'the client has disconnected on its own',
[DisconnectReason.NoOpenSocket]: 'the receiving end did not have an open socket',
[DisconnectReason.NewConnection]: 'the client connected from another location',
} as const satisfies Record<DisconnectReason | number, string>
export default HumanizedDisconnectReason