Skip to content

feat: Add API rate limiter with exponential backoff retry#321

Open
GuyKh wants to merge 2 commits intomainfrom
fix/add-rate-limiting
Open

feat: Add API rate limiter with exponential backoff retry#321
GuyKh wants to merge 2 commits intomainfrom
fix/add-rate-limiting

Conversation

@GuyKh
Copy link
Owner

@GuyKh GuyKh commented Feb 15, 2026

Summary

Add API rate limiting with exponential backoff retry logic to the coordinator.

Changes

  1. Rate Limiter: Added an asyncio.Semaphore(3) to limit concurrent API requests to 3 at a time
  2. Retry Helper: Added _execute_with_rate_limit() method that wraps API calls with:
    • Rate limiting via semaphore
    • Exponential backoff retry (3 retries, starting at 1s delay)
    • Proper logging of failures and retries

Benefits

  • Prevents API rate limiting errors from IEC
  • Adds resilience to network failures with automatic retry
  • Limits concurrent API calls to avoid overwhelming the IEC API

Add a semaphore-based rate limiter (max 3 concurrent requests) and
a helper method for executing API calls with retry logic and
exponential backoff (3 retries, starting at 1s delay).
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.

1 participant