Replace match for start_with method

pull/16368/head
Moisés Calzado 3 years ago
parent d10ae1286a
commit 497d02bc2b

@ -76,9 +76,9 @@ module Resque
response = http_client.delete(url, request_params.symbolize_keys)
response_code_string = response.code.to_s
if response_code_string.match?(/^2/)
if response_code_string.start_with?("2")
response.response_body
elsif (response_code_string.match?(/^5/) || response.code == 429) && retries < MAX_RETRY_ATTEMPTS
elsif (response_code_string.start_with?("5") || response.code == 429) && retries < MAX_RETRY_ATTEMPTS
sleep(RETRY_TIME_SECONDS**retries)
delete(url, request_params, retries: retries + 1)
end

Loading…
Cancel
Save