Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit e9e5096

Browse files
committed
Update retries to 3
1 parent de40365 commit e9e5096

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/codecov.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,21 @@ def format(result)
271271
'Accept' => 'application/json'
272272
})
273273
req.body = json
274+
retries = 3
274275

275276
# make request
276277
begin
277278
response = https.request(req)
278279
rescue TimeoutError => e
279-
puts 'Error uploading coverage reports to Codecov. Will retry'
280+
retries -= 1
281+
282+
if retries.zero?
283+
puts 'Timeout error uploading coverage reports to Codecov. Out of retries.'
284+
puts e
285+
return
286+
end
287+
288+
puts 'Timeout error uploading coverage reports to Codecov. Retrying...'
280289
puts e
281290
retry
282291
rescue StandardError => e

0 commit comments

Comments
 (0)