Sha256: 89823938ae974c580b66b14c4e8371c7057e2fcb46c147a2d88116e2bfbcd841
Contents?: true
Size: 512 Bytes
Versions: 20
Compression:
Stored size: 512 Bytes
Contents
# frozen_string_literal: true # 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)") % { time: time } sleep(time) @splayed = true end end
Version data entries
20 entries across 20 versions & 1 rubygems