Skip to content

Commit 4681254

Browse files
committed
Fix error
1 parent c5bfa46 commit 4681254

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/optimizely/cmab/cmab_client.rb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,12 @@ def _do_fetch_with_retry(url, request_body, retry_config, timeout)
150150
backoff = retry_config.retry_delay
151151

152152
(0..retry_config.max_retries).each do |attempt|
153-
begin
154-
return _do_fetch(url, request_body, timeout)
155-
rescue
156-
if attempt < retry_config.max_retries
157-
@logger.info("Retrying CMAB request (attempt: #{attempt + 1} after #{backoff} seconds)...")
158-
sleep(backoff)
159-
backoff = [backoff * (retry_config.backoff_multiplier**(attempt + 1)), retry_config.max_backoff].min
160-
end
153+
return _do_fetch(url, request_body, timeout)
154+
rescue
155+
if attempt < retry_config.max_retries
156+
@logger.info("Retrying CMAB request (attempt: #{attempt + 1} after #{backoff} seconds)...")
157+
sleep(backoff)
158+
backoff = [backoff * (retry_config.backoff_multiplier**(attempt + 1)), retry_config.max_backoff].min
161159
end
162160
end
163161

0 commit comments

Comments
 (0)