From 33124f2570a4d8c4dfa153120dbc06b3c725a25c Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sun, 22 Feb 2015 12:28:08 +0200 Subject: run #duration not #new_count @duration isn't set before #duration is ran --- lib/oxidized/jobs.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/oxidized/jobs.rb b/lib/oxidized/jobs.rb index 0511b49..3342679 100644 --- a/lib/oxidized/jobs.rb +++ b/lib/oxidized/jobs.rb @@ -1,12 +1,13 @@ module Oxidized class Jobs < Array + AVERAGE_DURATION = 5 # initially presume nodes take 5s to complete attr_accessor :interval, :max, :want def initialize max, interval, nodes @max = max @interval = interval @nodes = nodes - @durations = Array.new(@nodes.size, 5) # guess that nodes take 5s - new_count + @durations = Array.new @nodes.size, AVERAGE_DURATION + duration AVERAGE_DURATION super() end def duration last -- cgit v1.2.1