mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
Update resume.ts
This commit is contained in:
+6
-2
@@ -12,8 +12,11 @@ export async function resume(shardId: number) {
|
|||||||
const oldShard = ws.shards.get(shardId);
|
const oldShard = ws.shards.get(shardId);
|
||||||
|
|
||||||
if (oldShard) {
|
if (oldShard) {
|
||||||
// HOW TO CLOSE OLD SHARD SOCKET!!!
|
// ONLY CLOSE IF SHARD SOCKET IS STILL CONNECTED
|
||||||
oldShard.ws.close(3065, "Resuming the shard, closing old shard.");
|
if (oldShard.ws.readyState === WebSocket.OPEN) {
|
||||||
|
// HOW TO CLOSE OLD SHARD SOCKET!!!
|
||||||
|
oldShard.ws.close(3065, "Resuming the shard, closing old shard.");
|
||||||
|
}
|
||||||
// STOP OLD HEARTBEAT
|
// STOP OLD HEARTBEAT
|
||||||
clearInterval(oldShard.heartbeat.intervalId);
|
clearInterval(oldShard.heartbeat.intervalId);
|
||||||
}
|
}
|
||||||
@@ -40,6 +43,7 @@ export async function resume(shardId: number) {
|
|||||||
},
|
},
|
||||||
queue: oldShard?.queue || [],
|
queue: oldShard?.queue || [],
|
||||||
processingQueue: false,
|
processingQueue: false,
|
||||||
|
queueMinuteTimestamp: Date.now(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Resume on open
|
// Resume on open
|
||||||
|
|||||||
Reference in New Issue
Block a user