diff --git a/lib/abf_worker/status_inspector.rb b/lib/abf_worker/status_inspector.rb index 7ad4f3d42..6aa722c01 100644 --- a/lib/abf_worker/status_inspector.rb +++ b/lib/abf_worker/status_inspector.rb @@ -21,14 +21,14 @@ module AbfWorker status = {} queues.each do |worker| workers = Resque.workers.select{ |w| yield w, worker } - fill_status status, workers, worker + status[worker] = status_of_worker workers, worker end status end - def fill_status(status, workers, worker) + def status_of_worker(workers, worker) redis, key = Resque.redis, "queue:#{worker}_worker" - status[worker] = { + { :count => workers.count, :build_tasks => workers.select{ |w| w.working? }.count, :tasks => (redis.llen("#{key}_default") + redis.llen(key))