Sha256: 07c9ba31b246d3550cc5e0f65d3bd2f18d8383a9e6ab74587bf65c666f8a78c6

Contents?: true

Size: 446 Bytes

Versions: 62

Compression:

Stored size: 446 Bytes

Contents

module S3Website
  class Retry
    def self.run_with_retry(sleep_milliseconds = 3.000)
      attempt = 0
      begin
        yield
      rescue Exception => e
        $stderr.puts "Exception Occurred:  #{e.message} (#{e.class})  Retrying in 3 seconds..."
        sleep sleep_milliseconds
        attempt += 1
        if attempt <= 3
          retry
        else
          raise RetryAttemptsExhaustedError
        end
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 2 rubygems

Version Path
s3_website-1.8.2 lib/s3_website/retry.rb
s3_website-1.8.1 lib/s3_website/retry.rb
s3_website-1.8.0 lib/s3_website/retry.rb
s3_website_monadic-0.0.15 lib/s3_website/retry.rb
s3_website_monadic-0.0.14 lib/s3_website/retry.rb
s3_website_monadic-0.0.13 lib/s3_website/retry.rb
s3_website_monadic-0.0.12 lib/s3_website/retry.rb
s3_website_monadic-0.0.11 lib/s3_website/retry.rb
s3_website_monadic-0.0.9 lib/s3_website/retry.rb
s3_website_monadic-0.0.8 lib/s3_website/retry.rb
s3_website_monadic-0.0.7 lib/s3_website/retry.rb
s3_website_monadic-0.0.6 lib/s3_website/retry.rb
s3_website_monadic-0.0.5 lib/s3_website/retry.rb
s3_website-1.7.6 lib/s3_website/retry.rb
s3_website_monadic-0.0.4 lib/s3_website/retry.rb
s3_website_monadic-0.0.3 lib/s3_website/retry.rb
s3_website-1.7.5 lib/s3_website/retry.rb
s3_website_monadic-0.0.2 lib/s3_website/retry.rb
s3_website_monadic-0.0.1 lib/s3_website/retry.rb
s3_website-1.7.4 lib/s3_website/retry.rb