Skip to content

Commit cc42f32

Browse files
authored
Fog::AWS::Storage don't retry client errors (fog#691)
* Fog::AWS::Storage don't retry client errors Resolves fog#690 * Fog::AWS::Storage merge connection options
1 parent d1e78da commit cc42f32

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/fog/aws/storage.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ class Storage < Fog::Service
1414
'https' => 443
1515
}
1616

17+
DEFAULT_CONNECTION_OPTIONS = {
18+
retry_limit: 5,
19+
retry_interval: 1,
20+
retry_errors: [
21+
Excon::Error::Timeout, Excon::Error::Socket, Excon::Error::Server
22+
]
23+
}
24+
1725
MIN_MULTIPART_CHUNK_SIZE = 5242880
1826
MAX_SINGLE_PUT_SIZE = 5368709120
1927

@@ -546,7 +554,8 @@ def initialize(options={})
546554
@use_iam_profile = options[:use_iam_profile]
547555
@instrumentor = options[:instrumentor]
548556
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.storage'
549-
@connection_options = options[:connection_options] || { retry_limit: 5, retry_interval: 1 }
557+
@connection_options =
558+
DEFAULT_CONNECTION_OPTIONS.merge(options[:connection_options] || {})
550559
@persistent = options.fetch(:persistent, false)
551560
@acceleration = options.fetch(:acceleration, false)
552561
@signature_version = options.fetch(:aws_signature_version, 4)

0 commit comments

Comments
 (0)