diff options
author | Adam Winberg <adam.winberg@smhi.se> | 2016-05-27 13:00:25 +0200 |
---|---|---|
committer | Adam Winberg <adam.winberg@smhi.se> | 2016-05-27 13:00:25 +0200 |
commit | 51f4c2d0ba810c97000c3f5db37b198938683c13 (patch) | |
tree | 1662ce8273490e54e2b9f885fb75015e3ae219ae /lib/oxidized/jobs.rb | |
parent | f16660a2113321c4f0a1a5eaa7ef51048d25fa7c (diff) |
Added feature to disable polling based on interval
Diffstat (limited to 'lib/oxidized/jobs.rb')
-rw-r--r-- | lib/oxidized/jobs.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/oxidized/jobs.rb b/lib/oxidized/jobs.rb index 2c656f6..719bda9 100644 --- a/lib/oxidized/jobs.rb +++ b/lib/oxidized/jobs.rb @@ -6,6 +6,9 @@ module Oxidized def initialize max, interval, nodes @max = max + # Set interval to 1 if interval is 0 (=disabled) so we don't break + # the 'ceil' function + @interval = 1 if @interval == 0 @interval = interval @nodes = nodes @last = Time.now.utc |