summaryrefslogtreecommitdiff
path: root/lib/oxidized/jobs.rb
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2018-04-25 16:12:44 +0300
committerGitHub <noreply@github.com>2018-04-25 16:12:44 +0300
commit583bc422448a234a215113a15f8a6976c50b2296 (patch)
treeb3f757e6f37aa058a0c80e4ded3ef82553bc98c1 /lib/oxidized/jobs.rb
parent9a7d16c00163c421d2c9f3cb2783c76633860336 (diff)
parentdffae0f76656a57da8f5473ce21955638cbe1f7f (diff)
Merge pull request #1296 from wk/the-great-makeover
the great makeover - standardize layout, alignment, indentation
Diffstat (limited to 'lib/oxidized/jobs.rb')
-rw-r--r--lib/oxidized/jobs.rb7
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