There was an error while loading. Please reload this page.
2 parents ac221c7 + 8bd7081 commit 0a22c89Copy full SHA for 0a22c89
1 file changed
lib/quayio/scanner/repository.rb
@@ -27,11 +27,15 @@ def api_call(uri)
27
response = RestClient.get(
28
"https://quay.io/api/v1/repository/#{org}/#{repo}#{uri}",
29
authorization: "Bearer #{quayio_token}",
30
- accept: :json
+ accept: :json,
31
+ open_timeout: 15
32
)
33
return JSON.parse(response)
- rescue RestClient::ExceptionWithResponse => e
34
- raise e if e.http_code != 520 || attempt >= MAX_ATTEMPTS
+ rescue RestClient::Exception => e
35
+ raise e if attempt >= MAX_ATTEMPTS
36
+
37
+ # retry later, if we hit cdn rate limiting or on connection errors
38
+ raise e unless e.http_code == 520 || e.http_code.nil?
39
40
sleep(rand(10))
41
end
0 commit comments