diff options
author | Kamil TrzciĆski <ayufan@ayufan.eu> | 2017-03-18 02:06:11 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-03-18 02:06:11 +0300 |
commit | 12dd5ac22110bc3327297232d96f2afebaefc5eb (patch) | |
tree | c1ec703f9c7072df5097ba70c3e4e7c132a44a83 /app/services/ci/register_job_service.rb | |
parent | 94246c7aa01bd825953e6676f79aa9db51209822 (diff) |
All CI offline migrations
Diffstat (limited to 'app/services/ci/register_job_service.rb')
-rw-r--r-- | app/services/ci/register_job_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb index 0ab9042bf24..d6a4280ce4c 100644 --- a/app/services/ci/register_job_service.rb +++ b/app/services/ci/register_job_service.rb @@ -55,13 +55,13 @@ module Ci new_builds. # don't run projects which have not enabled shared runners and builds joins(:project).where(projects: { shared_runners_enabled: true }). - joins('LEFT JOIN project_features ON ci_builds.gl_project_id = project_features.project_id'). + joins('LEFT JOIN project_features ON ci_builds.project_id = project_features.project_id'). where('project_features.builds_access_level IS NULL or project_features.builds_access_level > 0'). # Implement fair scheduling # this returns builds that are ordered by number of running builds # we prefer projects that don't use shared runners at all - joins("LEFT JOIN (#{running_builds_for_shared_runners.to_sql}) AS project_builds ON ci_builds.gl_project_id=project_builds.gl_project_id"). + joins("LEFT JOIN (#{running_builds_for_shared_runners.to_sql}) AS project_builds ON ci_builds.project_id=project_builds.project_id"). order('COALESCE(project_builds.running_builds, 0) ASC', 'ci_builds.id ASC') end @@ -71,7 +71,7 @@ module Ci def running_builds_for_shared_runners Ci::Build.running.where(runner: Ci::Runner.shared). - group(:gl_project_id).select(:gl_project_id, 'count(*) AS running_builds') + group(:project_id).select(:project_id, 'count(*) AS running_builds') end def new_builds |