Skip to content

WIP: Add automatic retry attempts when the API retry limit is reached#335

Draft
tiagolupepic wants to merge 2 commits intomainfrom
feature/add-auto-retry-attempt-with-429-error
Draft

WIP: Add automatic retry attempts when the API retry limit is reached#335
tiagolupepic wants to merge 2 commits intomainfrom
feature/add-auto-retry-attempt-with-429-error

Conversation

@tiagolupepic
Copy link

Summary

This pull request introduces automatic retry logic for API requests that receive a 429 (Too Many Requests) response

Changes

  • Introduced a new Lago::Api::RetryLimitError class to represent retryable errors, and updated the client to raise this error on 429 responses (lib/lago/api/retry_limit_error.rb, lib/lago/api/connection.rb)
  • Added a with_retry_limit method that retries failed requests up to three times with a configurable wait time, and applied this logic to all HTTP methods (get, get_all, put, patch, destroy).

This commit introduces the with_retry_limit method to auto retry when a
api responds with 409 (rate limit reached).

For now, the values of number of retries are arbitrary and the time to
wait as well.
@cla-check-bot
Copy link

cla-check-bot bot commented Mar 17, 2026

Welcome back, @tiagolupepic!

It looks like we still need your CLA signature on file. Please sign it here:

Sign the CLA

Once signed, this PR will be automatically updated.

@cla-check-bot
Copy link

cla-check-bot bot commented Mar 17, 2026

Thanks, @tiagolupepic! 🎉

Your CLA has been signed and is now on file. We'll proceed with the review shortly.

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