Skip to content

Commit

Permalink
Merge pull request #561 from KennaSecurity/toolkit_serverbrokeconnection
Browse files Browse the repository at this point in the history
Update http.rb
  • Loading branch information
jgarber-cisco authored Nov 21, 2024
2 parents f46a318 + c175387 commit 938d17d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 938d17d

Please sign in to comment.