lib/backburner/workers/threads_on_fork.rb in backburner-allq-1.0.19 vs lib/backburner/workers/threads_on_fork.rb in backburner-allq-1.0.20
- old
+ new
@@ -208,20 +208,21 @@
# Run work_one_job while we can
def run_while_can(conn = connection)
puts "Run while can"
while @garbage_after.nil? or @garbage_after > @runs
@runs += 1 # FIXME: Likely race condition
- ran_job = work_one_job(conn)
+ ran_job = work_one_job(conn, @watched_tube_name)
# Wait a second if we didn't find a job
unless ran_job
puts "sleeping"
sleep(rand() * 3)
end
end
end
# Shortcut for watching a tube on our beanstalk connection
def watch_tube(name, conn = connection)
+ @watched_tube_name = name
# No op for allq
end
def on_reconnect(conn)
watch_tube(@watching_tube, conn) if @watching_tube