summaryrefslogtreecommitdiff
path: root/lib/oxidized/worker.rb
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-05-27 14:35:19 +0300
committerytti <saku@ytti.fi>2016-05-27 14:35:19 +0300
commit7da4179dd3e9fd298c190a5c856fb16114a1e0d3 (patch)
tree95300d76a406589cb462d3ae245c3681524292c0 /lib/oxidized/worker.rb
parentf16660a2113321c4f0a1a5eaa7ef51048d25fa7c (diff)
parent2d8e9087fa7ca25fcb46eb8b9e20a7ddf0293ec1 (diff)
Merge pull request #448 from wiad/issue-433
Added feature to disable polling based on interval
Diffstat (limited to 'lib/oxidized/worker.rb')
-rw-r--r--lib/oxidized/worker.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/oxidized/worker.rb b/lib/oxidized/worker.rb
index 324dcb5..48852ef 100644
--- a/lib/oxidized/worker.rb
+++ b/lib/oxidized/worker.rb
@@ -18,7 +18,9 @@ module Oxidized
# ask for next node in queue non destructive way
nextnode = @nodes.first
unless nextnode.last.nil?
- break if nextnode.last.end + Oxidized.config.interval > Time.now.utc
+ # Set unobtainable value for 'last' if interval checking is disabled
+ last = Oxidized.config.interval == 0 ? Time.now.utc + 10 : nextnode.last.end
+ break if last + Oxidized.config.interval > Time.now.utc
end
# shift nodes and get the next node
node = @nodes.get