Sha256: 3289324f0e8c940306bc1d682c42667540eabe0e8b89bd00da03a750780c5aa1
Contents?: true
Size: 933 Bytes
Versions: 13
Compression:
Stored size: 933 Bytes
Contents
module Backup module CloudIO class Error < Backup::Error; end class FileSizeError < Backup::Error; end class Base attr_reader :max_retries, :retry_waitsec def initialize(options = {}) @max_retries = options[:max_retries] @retry_waitsec = options[:retry_waitsec] end private def with_retries(operation) retries = 0 begin yield rescue => err retries += 1 raise Error.wrap(err, <<-EOS) if retries > max_retries Max Retries (#{max_retries}) Exceeded! Operation: #{operation} Be sure to check the log messages for each retry attempt. EOS Logger.info Error.wrap(err, <<-EOS) Retry ##{retries} of #{max_retries} Operation: #{operation} EOS sleep(retry_waitsec) retry end end end end end
Version data entries
13 entries across 13 versions & 4 rubygems