From 15fc1f0f4698125fb65be3a66906d80a92807a55 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 11 Jan 2017 21:32:59 +0200 Subject: add one thread when requesting next via API --- lib/oxidized/nodes.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/oxidized/nodes.rb') diff --git a/lib/oxidized/nodes.rb b/lib/oxidized/nodes.rb index f5a1ad0..011bfc3 100644 --- a/lib/oxidized/nodes.rb +++ b/lib/oxidized/nodes.rb @@ -4,7 +4,7 @@ module Oxidized class Oxidized::NotSupported < OxidizedError; end class Oxidized::NodeNotFound < OxidizedError; end class Nodes < Array - attr_accessor :source + attr_accessor :source, :jobs alias :put :unshift def load node_want=nil with_lock do @@ -73,6 +73,7 @@ module Oxidized # set last job to nil so that the node is picked for immediate update n.last = nil put n + jobs.want += 1 end end end -- cgit v1.2.1