lib/dumper/job.rb in dumper-1.3.2 vs lib/dumper/job.rb in dumper-1.3.3
- old
+ new
@@ -78,10 +78,20 @@
http = Net::HTTP.new(uri.host, uri.port)
if uri.is_a? URI::HTTPS
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
- response = http.request(request)
+
+ retry_count = 0
+ begin
+ response = http.request(request)
+ rescue Errno::ECONNRESET
+ raise if retry_count > 3
+ retry_count += 1
+ log "upload failed: #{$!} - retrying..."
+ retry
+ end
+
log "response from S3 = #{response.to_s}"
response
rescue
log_last_error
end