mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 00:40:07 +00:00
small fixes
This commit is contained in:
@@ -211,14 +211,27 @@ async function heartbeat(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!heartbeating.has(shard.id)) heartbeating.set(shard.id, false);
|
||||
else {
|
||||
if (heartbeating.has(shard.id)) {
|
||||
const receivedACK = heartbeating.get(shard.id);
|
||||
// If a ACK response was not received since last heartbeat, issue invalid session close
|
||||
if (!receivedACK) {
|
||||
shard.socket.send(JSON.stringify({ op: 4009 }));
|
||||
eventHandlers.debug?.(
|
||||
{
|
||||
type: "heartbeatStopped",
|
||||
data: {
|
||||
interval,
|
||||
previousSequenceNumber: shard.previousSequenceNumber,
|
||||
shardID: shard.id,
|
||||
},
|
||||
},
|
||||
);
|
||||
return shard.socket.send(JSON.stringify({ op: 4009 }));
|
||||
}
|
||||
}
|
||||
|
||||
// Set it to false as we are issuing a new heartbeat
|
||||
heartbeating.set(shard.id, false);
|
||||
|
||||
shard.socket.send(
|
||||
JSON.stringify(
|
||||
{ op: GatewayOpcode.Heartbeat, d: shard.previousSequenceNumber },
|
||||
|
||||
@@ -64,6 +64,7 @@ export interface DebugArg {
|
||||
| "requestManagerFetched"
|
||||
| "requestMembersProcessing"
|
||||
| "heartbeat"
|
||||
| "heartbeatStopped"
|
||||
| "createShard"
|
||||
| "invalidSession"
|
||||
| "reconnect"
|
||||
|
||||
Reference in New Issue
Block a user