Module: Puppet::Util::Splayer Private
- Included in:
- Agent, Application::Apply
- Defined in:
- lib/puppet/util/splayer.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Handle splay options (sleeping for a random interval before executing)
Instance Method Summary collapse
-
#splay(do_splay = Puppet[:splay]) ⇒ Object
private
Sleep when splay is enabled; else just return.
-
#splayed? ⇒ Boolean
private
Have we splayed already?.
Instance Method Details
#splay(do_splay = Puppet[:splay]) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sleep when splay is enabled; else just return.
9 10 11 12 13 14 15 16 17 |
# File 'lib/puppet/util/splayer.rb', line 9 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)") % { time: time } sleep(time) @splayed = true end |
#splayed? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Have we splayed already?
4 5 6 |
# File 'lib/puppet/util/splayer.rb', line 4 def splayed? !!@splayed end |