From 4d20d117522d473d7a4350db78dab606987a5b85 Mon Sep 17 00:00:00 2001 From: ITOH Date: Tue, 11 May 2021 18:54:59 +0200 Subject: [PATCH] add: logs --- src/ws/process_queue.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ws/process_queue.ts b/src/ws/process_queue.ts index 2fc897c9f..4c81fe47d 100644 --- a/src/ws/process_queue.ts +++ b/src/ws/process_queue.ts @@ -31,12 +31,18 @@ export async function processQueue(id: number) { typeof value === "bigint" ? value.toString() : Array.isArray(value) - ? value.map((v) => typeof v === "bigint" ? v.toString() : v) + ? value.map((v) => (typeof v === "bigint" ? v.toString() : v)) : 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)); // 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 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); shard.queueCounter = 0; continue;