Sha256: e8f95c696eafe3daa8609ee7ba0ce78a594df0160488d457a0b3f9340b8eaa9b

Contents?: true

Size: 462 Bytes

Versions: 155

Compression:

Stored size: 462 Bytes

Contents

# Handle splay options (sleeping for a random interval before executing)
module Puppet::Util::Splayer
  # Have we splayed already?
  def splayed?
    !!@splayed
  end

  # Sleep when splay is enabled; else just return.
  def splay(do_splay = Puppet[:splay])
    return unless do_splay
    return if splayed?

    time = rand(Puppet[:splaylimit] + 1)
    Puppet.info "Sleeping for #{time} seconds (splay is enabled)"
    sleep(time)
    @splayed = true
  end
end

Version data entries

155 entries across 155 versions & 2 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/util/splayer.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/util/splayer.rb
puppet-4.10.12 lib/puppet/util/splayer.rb
puppet-4.10.12-x86-mingw32 lib/puppet/util/splayer.rb
puppet-4.10.12-x64-mingw32 lib/puppet/util/splayer.rb
puppet-4.10.12-universal-darwin lib/puppet/util/splayer.rb
puppet-4.10.11 lib/puppet/util/splayer.rb
puppet-4.10.11-x86-mingw32 lib/puppet/util/splayer.rb
puppet-4.10.11-x64-mingw32 lib/puppet/util/splayer.rb
puppet-4.10.11-universal-darwin lib/puppet/util/splayer.rb
puppet-4.10.10 lib/puppet/util/splayer.rb
puppet-4.10.10-x86-mingw32 lib/puppet/util/splayer.rb
puppet-4.10.10-x64-mingw32 lib/puppet/util/splayer.rb
puppet-4.10.10-universal-darwin lib/puppet/util/splayer.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/util/splayer.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/util/splayer.rb
puppet-4.10.9 lib/puppet/util/splayer.rb
puppet-4.10.9-x86-mingw32 lib/puppet/util/splayer.rb
puppet-4.10.9-x64-mingw32 lib/puppet/util/splayer.rb
puppet-4.10.9-universal-darwin lib/puppet/util/splayer.rb