Sha256: 3fd771b94ee637596d8a52151d93c621d536bc2dcebac811539277c3be502bf3

Contents?: true

Size: 845 Bytes

Versions: 46

Compression:

Stored size: 845 Bytes

Contents

module Fog
  @interval = lambda { |retries| [2**(retries - 1), @max_interval].min }

  class << self
    attr_reader :interval
  end

  def self.interval=(interval)
    if interval.is_a?(Proc)
      raise ArgumentError, "interval proc must return a positive" unless interval.call(1) >= 0
    else
      raise ArgumentError, "interval must be non-negative" unless interval >= 0
    end
    @interval = interval
  end

  @timeout = 600

  class << self
    attr_reader :timeout
  end

  def self.timeout=(timeout)
    raise ArgumentError, "timeout must be non-negative" unless timeout >= 0
    @timeout = timeout
  end

  @max_interval = 60

  class << self
    attr_reader :max_interval
  end

  def self.max_interval=(interval)
    raise ArgumentError, "interval must be non-negative" unless interval >= 0
    @max_interval = interval
  end
end

Version data entries

46 entries across 43 versions & 3 rubygems

Version Path
fog-core-2.3.0 lib/fog/core/wait_for_defaults.rb
fog-core-2.2.4 lib/fog/core/wait_for_defaults.rb
fog-core-2.2.3 lib/fog/core/wait_for_defaults.rb
fog-core-2.2.2 lib/fog/core/wait_for_defaults.rb
fog-core-2.2.1 lib/fog/core/wait_for_defaults.rb
fog-core-2.2.0 lib/fog/core/wait_for_defaults.rb
fog-core-2.1.2 lib/fog/core/wait_for_defaults.rb
fog-core-2.1.1 lib/fog/core/wait_for_defaults.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-core-1.45.0/lib/fog/core/wait_for_defaults.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-core-1.45.0/lib/fog/core/wait_for_defaults.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-core-2.1.0/lib/fog/core/wait_for_defaults.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-core-1.45.0/lib/fog/core/wait_for_defaults.rb
fog-core-2.1.0 lib/fog/core/wait_for_defaults.rb
fog-core-2.0.0 lib/fog/core/wait_for_defaults.rb
fog-core-1.45.0 lib/fog/core/wait_for_defaults.rb
fog-core-1.44.3 lib/fog/core/wait_for_defaults.rb
fog-core-1.44.2 lib/fog/core/wait_for_defaults.rb
fog-core-1.44.1 lib/fog/core/wait_for_defaults.rb
fog-core-1.44.0 lib/fog/core/wait_for_defaults.rb
fog-core-1.43.0 lib/fog/core/wait_for_defaults.rb