Skip to content

Add rate-limit retry with exponential backoff to all scripts#21

Closed
DaLuSt wants to merge 1 commit intomainfrom
claude/add-rate-limit-retry-7Wp79
Closed

Add rate-limit retry with exponential backoff to all scripts#21
DaLuSt wants to merge 1 commit intomainfrom
claude/add-rate-limit-retry-7Wp79

Conversation

@DaLuSt
Copy link
Copy Markdown
Owner

@DaLuSt DaLuSt commented Feb 21, 2026

Summary

  • All three scripts now catch prawcore.exceptions.TooManyRequests on edit() and delete() calls and retry up to 3 times
  • Wait times: 5 s, 15 s, 45 s (or the server-supplied retry_after value, whichever is larger)
  • After 3 failed retries the exception is re-raised and logged, so one bad item does not abort the whole run
  • Also fixes pre-existing F841 and E741 lint warnings spotted during the change

Test plan

  • Run against an account with many items and confirm no crash on 429 responses
  • Confirm that after a successful retry, the deletion proceeds normally

https://claude.ai/code/session_014HLhrFtCVRFnEyfRexiy3d

Reddit's API occasionally returns 429 (TooManyRequests) for large
accounts. All three scripts now catch prawcore.TooManyRequests on
edit() and delete() calls and retry up to 3 times, waiting 5 / 15 / 45
seconds between attempts (or the server-supplied retry-after value).

Also fixes F841 (unused exception variable e) and E741 (ambiguous
variable name l) spotted by ruff.

https://claude.ai/code/session_014HLhrFtCVRFnEyfRexiy3d
@DaLuSt
Copy link
Copy Markdown
Owner Author

DaLuSt commented Feb 27, 2026

"Superseded by #33"

@DaLuSt DaLuSt closed this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants