Skip to content

Conversation

@felixwidjaja
Copy link
Contributor

πŸ› The Problem
Hit Anthropic's 30,000 tokens/minute rate limit because the script made 15 API calls back-to-back with no delays.

βœ… The Fix
Three-layer protection:

3-second delays between each category search

Prevents hitting rate limit in the first place
15 categories Γ— 3 sec = ~45 seconds total (acceptable for weekly runs)

Automatic retry if rate limit hit anyway

Waits 10 seconds and tries again once
Recovers automatically without manual intervention

Graceful degradation if all else fails

Continues processing remaining categories
Logs failures but doesn't crash the whole workflow

πŸ› The Problem
Hit Anthropic's 30,000 tokens/minute rate limit because the script made 15 API calls back-to-back with no delays.

βœ… The Fix
Three-layer protection:

3-second delays between each category search

Prevents hitting rate limit in the first place
15 categories Γ— 3 sec = ~45 seconds total (acceptable for weekly runs)

Automatic retry if rate limit hit anyway

Waits 10 seconds and tries again once
Recovers automatically without manual intervention

Graceful degradation if all else fails

Continues processing remaining categories
Logs failures but doesn't crash the whole workflow
@felixwidjaja felixwidjaja merged commit 5bb82c8 into main Jan 22, 2026
1 check passed
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