Permalink
Browse files

Updated status_inspector

  • Loading branch information...
1 parent 1e721a8 commit ccd32a4eb2d7cffe7ad5e5f9a302645b2113e425 @avokhmin avokhmin committed Feb 25, 2014
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/abf_worker/status_inspector.rb
@@ -9,13 +9,21 @@ def projects_status
result[:rpm][:workers] += nodes[:systems]
result[:rpm][:build_tasks] += nodes[:busy]
result[:rpm][:other_workers] = nodes[:others]
+
external_bls = BuildList.for_status(BuildList::BUILD_PENDING).external_nodes(:everything).count
- result[:rpm][:default_tasks] += external_bls
- result[:rpm][:tasks] += external_bls
+ result[:rpm][:default_tasks] += external_bls + count_of_tasks('user_build_')
+
+ result[:rpm][:tasks] += external_bls + count_of_tasks('mass_build_')
result
end
end
+ def count_of_tasks(regexp)
+ Resque.redis.smembers('queues').
+ select{ |q| q =~ /#{regexp}/ }.
+ map{ |q| Resque.redis.llen("queue:#{q}") }.sum
+ end
+
def products_status
get_status(:iso) { |w, worker|
str = w.to_s

0 comments on commit ccd32a4

Please sign in to comment.