Skip to content

Commit

Permalink
Fog::AWS::Storage don't retry client errors (#691)
Browse files Browse the repository at this point in the history
* Fog::AWS::Storage don't retry client errors

Resolves #690

* Fog::AWS::Storage merge connection options
  • Loading branch information
rahim authored Sep 29, 2023
1 parent d1e78da commit cc42f32
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/fog/aws/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ class Storage < Fog::Service
'https' => 443
}

DEFAULT_CONNECTION_OPTIONS = {
retry_limit: 5,
retry_interval: 1,
retry_errors: [
Excon::Error::Timeout, Excon::Error::Socket, Excon::Error::Server
]
}

MIN_MULTIPART_CHUNK_SIZE = 5242880
MAX_SINGLE_PUT_SIZE = 5368709120

Expand Down Expand Up @@ -546,7 +554,8 @@ def initialize(options={})
@use_iam_profile = options[:use_iam_profile]
@instrumentor = options[:instrumentor]
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.storage'
@connection_options = options[:connection_options] || { retry_limit: 5, retry_interval: 1 }
@connection_options =
DEFAULT_CONNECTION_OPTIONS.merge(options[:connection_options] || {})
@persistent = options.fetch(:persistent, false)
@acceleration = options.fetch(:acceleration, false)
@signature_version = options.fetch(:aws_signature_version, 4)
Expand Down

0 comments on commit cc42f32

Please sign in to comment.