summaryrefslogtreecommitdiff
path: root/lib/oxidized/worker.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/worker.rb')
-rw-r--r--lib/oxidized/worker.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/oxidized/worker.rb b/lib/oxidized/worker.rb
index fcdd6f0..a97e5da 100644
--- a/lib/oxidized/worker.rb
+++ b/lib/oxidized/worker.rb
@@ -13,6 +13,12 @@ module Oxidized
ended.each { |job| process job }
while @jobs.size < @jobs.want
Log.debug "Jobs #{@jobs.size}, Want: #{@jobs.want}"
+ # ask for next node in queue non destructive way
+ nextnode = @nodes.first
+ unless nextnode.last.nil?
+ break if nextnode.last.end + CFG.interval > Time.now.utc
+ end
+ # shift nodes and get the next node
node = @nodes.get
node.running? ? next : node.running = true
@jobs.push Job.new node