mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-15 04:26:30 +00:00
Filter out account limits that already reset
This commit is contained in:
parent
3572dd7771
commit
bbd68e6840
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue