diff options
author | ytti <saku@ytti.fi> | 2016-05-27 14:35:19 +0300 |
---|---|---|
committer | ytti <saku@ytti.fi> | 2016-05-27 14:35:19 +0300 |
commit | 7da4179dd3e9fd298c190a5c856fb16114a1e0d3 (patch) | |
tree | 95300d76a406589cb462d3ae245c3681524292c0 /lib/oxidized/jobs.rb | |
parent | f16660a2113321c4f0a1a5eaa7ef51048d25fa7c (diff) | |
parent | 2d8e9087fa7ca25fcb46eb8b9e20a7ddf0293ec1 (diff) |
Merge pull request #448 from wiad/issue-433
Added feature to disable polling based on interval
Diffstat (limited to 'lib/oxidized/jobs.rb')
-rw-r--r-- | lib/oxidized/jobs.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/oxidized/jobs.rb b/lib/oxidized/jobs.rb index 2c656f6..c566778 100644 --- a/lib/oxidized/jobs.rb +++ b/lib/oxidized/jobs.rb @@ -6,7 +6,9 @@ module Oxidized def initialize max, interval, nodes @max = max - @interval = interval + # Set interval to 1 if interval is 0 (=disabled) so we don't break + # the 'ceil' function + @interval = interval == 0 ? 1 : interval @nodes = nodes @last = Time.now.utc @durations = Array.new @nodes.size, AVERAGE_DURATION |