@@ -153,22 +153,20 @@ def _do_fetch_with_retry(url, request_body, retry_config, timeout)
153
153
backoff = retry_config . initial_backoff
154
154
155
155
( 0 ..retry_config . max_retries ) . each do |attempt |
156
- begin
157
- variation_id = _do_fetch ( url , request_body , timeout )
158
- return variation_id
159
- rescue StandardError => e
160
- if attempt < retry_config . max_retries
161
- @logger . log ( Logger ::INFO , "Retrying CMAB request (attempt #{ attempt + 1 } ) after #{ backoff } seconds..." )
162
- Kernel . sleep ( backoff )
163
-
164
- backoff = [
165
- backoff * ( retry_config . backoff_multiplier **( attempt + 1 ) ) ,
166
- retry_config . max_backoff
167
- ] . min
168
- else
169
- @logger . log ( Logger ::ERROR , "Max retries exceeded for CMAB request: #{ e . message } " )
170
- raise Optimizely ::CmabFetchError , "CMAB decision fetch failed (#{ e . message } )."
171
- end
156
+ variation_id = _do_fetch ( url , request_body , timeout )
157
+ return variation_id
158
+ rescue StandardError => e
159
+ if attempt < retry_config . max_retries
160
+ @logger . log ( Logger ::INFO , "Retrying CMAB request (attempt #{ attempt + 1 } ) after #{ backoff } seconds..." )
161
+ Kernel . sleep ( backoff )
162
+
163
+ backoff = [
164
+ backoff * ( retry_config . backoff_multiplier **( attempt + 1 ) ) ,
165
+ retry_config . max_backoff
166
+ ] . min
167
+ else
168
+ @logger . log ( Logger ::ERROR , "Max retries exceeded for CMAB request: #{ e . message } " )
169
+ raise Optimizely ::CmabFetchError , "CMAB decision fetch failed (#{ e . message } )."
172
170
end
173
171
end
174
172
0 commit comments