#848: small refactoring
This commit is contained in:
parent
262483f30b
commit
e1b79a3c1f
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue