Skip to content

Commit da667ee

Browse files
committed
correct the calculation
1 parent cae486d commit da667ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/optimizely/cmab/cmab_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def _do_fetch_with_retry(url, request_body, retry_config, timeout)
159159
@logger.log(Logger::INFO, "Retrying CMAB request (attempt #{attempt + 1}) after #{backoff} seconds...")
160160
Kernel.sleep(backoff)
161161
attempt += 1
162-
backoff = [retry_config.initial_backoff * (retry_config.backoff_multiplier**attempt), retry_config.max_backoff].min
162+
backoff = [backoff * (retry_config.backoff_multiplier ** (attempt + 1)), retry_config.max_backoff].min
163163
retry
164164
else
165165
@logger.log(Logger::ERROR, "Max retries exceeded for CMAB request: #{e.message}")

0 commit comments

Comments
 (0)