Commit d4bda7c1 authored by Alexis Reigel's avatar Alexis Reigel

use union for Project#any_runners?

parent dd785467
...@@ -1324,9 +1324,9 @@ class Project < ActiveRecord::Base ...@@ -1324,9 +1324,9 @@ class Project < ActiveRecord::Base
end end
def any_runners?(&block) def any_runners?(&block)
active_runners.any?(&block) || union = Gitlab::SQL::Union.new([active_runners, active_shared_runners, active_group_runners])
active_shared_runners.any?(&block) || runners = Ci::Runner.from("(#{union.to_sql}) ci_runners")
active_group_runners.any?(&block) runners.any?(&block)
end end
def valid_runners_token?(token) def valid_runners_token?(token)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment