Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated status_inspector

  • Loading branch information...
commit ccd32a4eb2d7cffe7ad5e5f9a302645b2113e425 1 parent 1e721a8
@avokhmin avokhmin authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/abf_worker/status_inspector.rb
View
12 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
Please sign in to comment.
Something went wrong with that request. Please try again.