We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd1c48e commit 98c3c93Copy full SHA for 98c3c93
1 file changed
src/gateway/server/ws-connection.ts
@@ -160,6 +160,11 @@ export function attachGatewayWsConnectionHandler(params: AttachGatewayWsConnecti
160
let lastFrameType: string | undefined;
161
let lastFrameMethod: string | undefined;
162
let lastFrameId: string | undefined;
163
+ const pingTimer = setInterval(() => {
164
+ try {
165
+ socket.ping();
166
+ } catch {}
167
+ }, 25_000);
168
169
const setCloseCause = (cause: string, meta?: Record<string, unknown>) => {
170
if (!closeCause) {
@@ -207,6 +212,7 @@ export function attachGatewayWsConnectionHandler(params: AttachGatewayWsConnecti
207
212
}
208
213
closed = true;
209
214
clearTimeout(handshakeTimer);
215
+ clearInterval(pingTimer);
210
216
releasePreauthBudget();
211
217
if (client) {
218
clients.delete(client);
0 commit comments