Skip to content

Commit 83b0f8b

Browse files
committed
Retry limited accounts after an hour
1 parent 41fa47b commit 83b0f8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/auth.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import experimental/parser/session
66
# max requests at a time per session to avoid race conditions
77
const
88
maxConcurrentReqs = 2
9-
dayInSeconds = 24 * 60 * 60
9+
hourInSeconds = 60 * 60
1010
apiMaxReqs: Table[Api, int] = {
1111
Api.search: 50,
1212
Api.tweetDetail: 500,
@@ -127,7 +127,7 @@ proc isLimited(session: Session; api: Api): bool =
127127
return true
128128

129129
if session.limited and api != Api.userTweets:
130-
if (epochTime().int - session.limitedAt) > dayInSeconds:
130+
if (epochTime().int - session.limitedAt) > hourInSeconds:
131131
session.limited = false
132132
log "resetting limit: ", session.id
133133
return false

0 commit comments

Comments
 (0)