Module: Reyes::Utils

Includes:
Chalk::Log
Defined in:
lib/reyes/utils.rb

Class Method Summary collapse

Class Method Details

.sleep_random(max) ⇒ Object

Sleep a random number of seconds, at least zero and less than ‘max`.

Parameters:

  • max (Numeric)


8
9
10
11
12
# File 'lib/reyes/utils.rb', line 8

def self.sleep_random(max)
  delay = Random.rand(max)
  log.info("Sleeping #{delay} seconds -- chosen from [0, #{max})")
  sleep(delay)
end