Unified · Split
| @@ -54,7 +54,7 @@ module Docs · 53 unmodified lines | |||
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | def handle_response(response) | 56 | def handle_response(response) |
| 57 | if response.code.to_i == 0 || (response.code.to_i >= 500 && response.code.to_i < 600) | 57 | if ENV['RETRY'] == '1' && [0, 500, 501, 502, 503, 504].include?(response.code.to_i) |
| 58 | instrument 'handle_response.retry', url: response.url do | 58 | instrument 'handle_response.retry', url: response.url do |
| 59 | build_and_queue_request(response.url) | 59 | build_and_queue_request(response.url) |
| 60 | end | 60 | end |