diff options
author | Ron <rgnv@users.noreply.github.com> | 2018-04-27 06:24:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 06:24:56 -0700 |
commit | 2bb40ad4d9e31cf2cd63a373f7c607eb86547e46 (patch) | |
tree | c12b52f0acd5192c457fa07189c4946674cd11fb /lib/oxidized/jobs.rb | |
parent | ec90b081f0fed05497ce6ae21e4b4ba4d44ecc01 (diff) | |
parent | 83a00943d7333fafdfe352173713a22a5ac89f6f (diff) |
Merge pull request #1 from wk/pr-1280
massage into rubocop compliance
Diffstat (limited to 'lib/oxidized/jobs.rb')
-rw-r--r-- | lib/oxidized/jobs.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/oxidized/jobs.rb b/lib/oxidized/jobs.rb index c566778..fdc1cbf 100644 --- a/lib/oxidized/jobs.rb +++ b/lib/oxidized/jobs.rb @@ -6,7 +6,7 @@ module Oxidized def initialize max, interval, nodes @max = max - # Set interval to 1 if interval is 0 (=disabled) so we don't break + # Set interval to 1 if interval is 0 (=disabled) so we don't break # the 'ceil' function @interval = interval == 0 ? 1 : interval @nodes = nodes @@ -28,7 +28,7 @@ module Oxidized @durations.fill AVERAGE_DURATION, @durations.size...@nodes.size end @durations.push(last).shift - @duration = @durations.inject(:+).to_f / @nodes.size #rolling average + @duration = @durations.inject(:+).to_f / @nodes.size # rolling average new_count end @@ -45,9 +45,8 @@ module Oxidized # and c) there is more than MAX_INTER_JOB_GAP since last one was started # then we want one more thread (rationale is to fix hanging thread causing HOLB) if @want <= size and @want < @nodes.size - @want +=1 if (Time.now.utc - @last) > MAX_INTER_JOB_GAP + @want += 1 if (Time.now.utc - @last) > MAX_INTER_JOB_GAP end end - end end |