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
end
def any_runners?(&block)
active_runners.any?(&block) ||
active_shared_runners.any?(&block) ||
active_group_runners.any?(&block)
union = Gitlab::SQL::Union.new([active_runners, active_shared_runners, active_group_runners])
runners = Ci::Runner.from("(#{union.to_sql}) ci_runners")
runners.any?(&block)
end
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