class Google::Cloud::Env::Retries

def initialize max_tries: 1,

Parameters:
  • delay_includes_time_elapsed (true, false) -- Whether to deduct any
  • delay_adder (Numeric) -- Value added to the delay between
  • delay_multiplier (Numeric) -- Multipler applied to the delay
  • max_delay (Numeric, nil) -- Maximum delay between attempts, in
  • initial_delay (Numeric) -- Initial delay between attempts, in
  • max_time (Numeric, nil) -- The maximum amount of time in seconds
  • max_tries (Integer, nil) -- Maximum number of attempts before we
def initialize max_tries: 1,
               max_time: nil,
               initial_delay: 0,
               max_delay: nil,
               delay_multiplier: 1,
               delay_adder: 0,
               delay_includes_time_elapsed: false
  @max_tries = max_tries&.to_i
  raise ArgumentError, "max_tries must be positive" if @max_tries && !@max_tries.positive?
  @max_time = max_time
  raise ArgumentError, "max_time must be positive" if @max_time && !@max_time.positive?
  @initial_delay = initial_delay
  raise ArgumentError, "initial_delay must be nonnegative" if @initial_delay&.negative?
  @max_delay = max_delay
  raise ArgumentError, "max_delay must be nonnegative" if @max_delay&.negative?
  @delay_multiplier = delay_multiplier
  @delay_adder = delay_adder
  @delay_includes_time_elapsed = delay_includes_time_elapsed
  reset!
end