Skip to content

Commit

Permalink
Make sure the sleep time is positive before sleeping
Browse files Browse the repository at this point in the history
  • Loading branch information
eric committed Mar 23, 2012
1 parent c8d354a commit 087e606
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/metriks/reporter/logger.rb
Expand Up @@ -121,7 +121,9 @@ def initialize(interval)

def sleep
sleep_time = next_time - Time.now.to_f
Kernel.sleep(sleep_time)
if sleep_time > 0
Kernel.sleep(sleep_time)
end
end

def next_time
Expand Down

0 comments on commit 087e606

Please sign in to comment.