app/models/extface/driver.rb in extface-0.4.0 vs app/models/extface/driver.rb in extface-0.4.1a
- old
+ new
@@ -45,15 +45,15 @@
end
def push(buffer)
if @job
#retry if current device job is not @job (waiting on queue)
- wait_on_queue = false
+ wait_on_queue = 20 #stop me writing endless things
begin
if current_device_job = device.jobs(true).active.try(:first)
if current_device_job != @job
- wait_on_queue = true
+ #wait_on_queue = 20 #FIXME!
p "#### current_job is not first_on_queue"
end
end
Timeout.timeout(Extface.device_timeout) do
Extface.redis_block do |r|
@@ -68,11 +68,10 @@
end
end
end
end
rescue Timeout::Error
- p "###########3 timeout err"
- retry if wait_on_queue
+ (wait_on_queue -= 1) > 0 ? retry : raise(e) #let it be!
end
else
raise "No job given"
end
end