From 2638cf12d2832f183066e8573e6110205c23ea35 Mon Sep 17 00:00:00 2001 From: Stoica Alex Date: Fri, 12 Jul 2024 10:59:12 +0100 Subject: [PATCH] Add 502 to specific list of retryable HTTP errors Fix an issue where we check the code (string) presence in an array of Int values. --- lib/ruby_snowflake/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ruby_snowflake/client.rb b/lib/ruby_snowflake/client.rb index 1b32980..09c7bb9 100644 --- a/lib/ruby_snowflake/client.rb +++ b/lib/ruby_snowflake/client.rb @@ -220,7 +220,7 @@ def raise_on_bad_response(response) def retryable_http_response_code?(code) # retry (in order): bad request, forbidden (token expired in flight), method not allowed, # request timeout, too many requests, anything in the 500 range (504 is fairly common) - [400, 403, 405, 408, 429, 504].include?(code.to_i) || (500..599).include?(code) + [400, 403, 405, 408, 429, 502, 504].include?(code.to_i) || (500..599).include?(code.to_i) end def retryable_log_method