mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 01:10:07 +00:00
queueStartedAt
This commit is contained in:
@@ -33,7 +33,7 @@ export async function identify(shardId: number, maxShards: number) {
|
||||
},
|
||||
queue: [],
|
||||
processingQueue: false,
|
||||
queueMinuteTimestamp: Date.now(),
|
||||
queueStartedAt: Date.now(),
|
||||
});
|
||||
|
||||
socket.onopen = () => {
|
||||
|
||||
@@ -17,8 +17,8 @@ export async function processQueue(id: number) {
|
||||
}
|
||||
|
||||
const now = Date.now();
|
||||
if (now - shard.queueMinuteTimestamp >= 60000) {
|
||||
shard.queueMinuteTimestamp = now;
|
||||
if (now - shard.queueStartedAt >= 60000) {
|
||||
shard.queueStartedAt = now;
|
||||
counter = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export async function resume(shardId: number) {
|
||||
},
|
||||
queue: oldShard?.queue || [],
|
||||
processingQueue: false,
|
||||
queueMinuteTimestamp: Date.now(),
|
||||
queueStartedAt: Date.now(),
|
||||
});
|
||||
|
||||
// Resume on open
|
||||
|
||||
@@ -146,7 +146,7 @@ export interface DiscordenoShard {
|
||||
/** Whether or not the queue for this shard is being processed. */
|
||||
processingQueue: boolean;
|
||||
/** When the first request for this minute has been sent. */
|
||||
queueMinuteTimestamp: number;
|
||||
queueStartedAt: number;
|
||||
}
|
||||
|
||||
export interface WebSocketRequest {
|
||||
|
||||
Reference in New Issue
Block a user