From bbd68e684071e8b26fca89587db48f12417a9bf0 Mon Sep 17 00:00:00 2001 From: Zed Date: Sat, 19 Aug 2023 01:13:36 +0200 Subject: [PATCH] Filter out account limits that already reset --- src/tokens.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tokens.nim b/src/tokens.nim index 71a7abd..401dc05 100644 --- a/src/tokens.nim +++ b/src/tokens.nim @@ -19,6 +19,8 @@ proc getPoolJson*(): JsonNode = totalPending = 0 reqsPerApi: Table[string, int] + let now = epochTime() + for account in accountPool: totalPending.inc(account.pending) list[account.id] = %*{ @@ -27,6 +29,9 @@ proc getPoolJson*(): JsonNode = } for api in account.apis.keys: + if (now.int - account.apis[api].reset) / 60 > 15: + continue + list[account.id]["apis"][$api] = %account.apis[api].remaining let