mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
add: logs
This commit is contained in:
+13
-2
@@ -31,12 +31,18 @@ export async function processQueue(id: number) {
|
|||||||
typeof value === "bigint"
|
typeof value === "bigint"
|
||||||
? value.toString()
|
? value.toString()
|
||||||
: Array.isArray(value)
|
: Array.isArray(value)
|
||||||
? value.map((v) => typeof v === "bigint" ? v.toString() : v)
|
? value.map((v) => (typeof v === "bigint" ? v.toString() : v))
|
||||||
: value,
|
: value,
|
||||||
`Running forEach loop in ws.processQueue function for changing bigints to strings.`,
|
`Running forEach loop in ws.processQueue function for changing bigints to strings.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ws.log("DEBUG", {
|
||||||
|
message: "Sending gateway request",
|
||||||
|
shardId: shard.id,
|
||||||
|
request,
|
||||||
|
});
|
||||||
|
|
||||||
shard.ws.send(JSON.stringify(request));
|
shard.ws.send(JSON.stringify(request));
|
||||||
|
|
||||||
// Counter is useful for preventing 120/m requests.
|
// Counter is useful for preventing 120/m requests.
|
||||||
@@ -44,6 +50,11 @@ export async function processQueue(id: number) {
|
|||||||
|
|
||||||
// Handle if the requests have been maxed
|
// Handle if the requests have been maxed
|
||||||
if (shard.queueCounter >= 118) {
|
if (shard.queueCounter >= 118) {
|
||||||
|
ws.log("DEBUG", {
|
||||||
|
message:
|
||||||
|
"Max gateway requests per minute reached setting timeout for one minute",
|
||||||
|
shardId: shard.id,
|
||||||
|
});
|
||||||
await delay(60000);
|
await delay(60000);
|
||||||
shard.queueCounter = 0;
|
shard.queueCounter = 0;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user