add lower bound
This commit is contained in:
parent
a2adba3b3d
commit
d3e337aa25
3
main.rb
3
main.rb
@ -123,6 +123,9 @@ bot.run(true)
|
|||||||
logger.info("Starting bot main loop")
|
logger.info("Starting bot main loop")
|
||||||
loop do
|
loop do
|
||||||
timer = Astro::Moon.phase.phase * (3600 * (1 + rand(3)))
|
timer = Astro::Moon.phase.phase * (3600 * (1 + rand(3)))
|
||||||
|
if timer < 900 #lower limit of 15 minutes
|
||||||
|
timer = 900
|
||||||
|
end
|
||||||
logger.info("sleeping for #{timer} seconds")
|
logger.info("sleeping for #{timer} seconds")
|
||||||
sleep timer
|
sleep timer
|
||||||
t = Time.new
|
t = Time.new
|
||||||
|
Loading…
Reference in New Issue
Block a user