From 83b0f8b55ae7bfb8a19a0bf14de52f30d06b8db6 Mon Sep 17 00:00:00 2001 From: Zed Date: Sat, 5 Apr 2025 15:57:14 +0100 Subject: [PATCH] Retry limited accounts after an hour --- src/auth.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth.nim b/src/auth.nim index 0ff40f8..81f248a 100644 --- a/src/auth.nim +++ b/src/auth.nim @@ -6,7 +6,7 @@ import experimental/parser/session # max requests at a time per session to avoid race conditions const maxConcurrentReqs = 2 - dayInSeconds = 24 * 60 * 60 + hourInSeconds = 60 * 60 apiMaxReqs: Table[Api, int] = { Api.search: 50, Api.tweetDetail: 500, @@ -127,7 +127,7 @@ proc isLimited(session: Session; api: Api): bool = return true if session.limited and api != Api.userTweets: - if (epochTime().int - session.limitedAt) > dayInSeconds: + if (epochTime().int - session.limitedAt) > hourInSeconds: session.limited = false log "resetting limit: ", session.id return false