1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 05:09:38 +02:00

Use faraday retry, move retry logic to concrete provider level (#2042)

This commit is contained in:
Zach Gollwitzer 2025-04-01 08:41:49 -04:00 committed by GitHub
parent 0a17b84566
commit 939244bd3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 50 additions and 90 deletions

View file

@ -1,19 +0,0 @@
module Retryable
def retrying(retryable_errors = [], max_retries: 3)
attempts = 0
begin
on_last_attempt = attempts == max_retries - 1
yield on_last_attempt
rescue *retryable_errors => e
attempts += 1
if attempts < max_retries
retry
else
raise e
end
end
end
end