Commit 98ed79ff authored by Grzegorz Bizon's avatar Grzegorz Bizon

Use denormalize runner type to improve builds fair scheduling

parent b2cb784c
......@@ -121,7 +121,7 @@ module Gitlab
::Ci::Build.running
.where(runner: ::Ci::Runner.instance_type)
.group(:project_id)
.select(:project_id, 'count(*) AS running_builds')
.select(:project_id, 'COUNT(*) AS running_builds')
end
end
......@@ -211,9 +211,9 @@ module Gitlab
def running_builds_for_shared_runners
::Ci::RunningBuild
.where(runner: ::Ci::Runner.instance_type)
.instance_type
.group(:project_id)
.select(:project_id, 'count(*) AS running_builds')
.select(:project_id, 'COUNT(*) AS running_builds')
end
# rubocop:enable CodeReuse/ActiveRecord
end
......
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