diff --git a/lib/http.rb b/lib/http.rb index 4e820c4d..51b9d655 100644 --- a/lib/http.rb +++ b/lib/http.rb @@ -39,6 +39,12 @@ def http_get(url, headers, max_retries = 5, verify_ssl = true) log_exception(e) rescue RestClient::ServerBrokeConnection => e log_exception(e) + if retries < max_retries + retries += 1 + print "Retrying!" + sleep(15) + retry + end rescue RestClient::ExceptionWithResponse => e log_exception(e) if retries < max_retries @@ -103,6 +109,12 @@ def http_post(url, headers, payload, max_retries = 5, verify_ssl = true) end rescue RestClient::ServerBrokeConnection => e log_exception(e) + if retries < max_retries + retries += 1 + print "Retrying!" + sleep(15) + retry + end rescue RestClient::ExceptionWithResponse => e log_exception(e) if retries < max_retries