Permalink
Browse files

Make sure the sleep time is positive before sleeping

  • Loading branch information...
1 parent c8d354a commit 087e606d4de935198814423178d91bd5cf19dcd2 @eric committed Mar 23, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/metriks/reporter/logger.rb
@@ -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

0 comments on commit 087e606

Please sign in to comment.