From 259a85e6658d91a7eb17b752b3f54c023625e08d Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Mon, 5 Mar 2018 22:02:50 +0900 Subject: Drop running_or_pending_build_count --- app/models/ci/build.rb | 1 - app/models/project.rb | 6 ------ 2 files changed, 7 deletions(-) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index b230b7f47ef..3f037822154 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -359,7 +359,6 @@ module Ci project.execute_hooks(build_data.dup, :job_hooks) project.execute_services(build_data.dup, :job_hooks) PagesService.new(build_data).execute - project.running_or_pending_build_count(force: true) end def artifacts_metadata_entry(path, **options) diff --git a/app/models/project.rb b/app/models/project.rb index a11b1e4f554..58c4094918c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1494,12 +1494,6 @@ class Project < ActiveRecord::Base update_column(:import_jid, nil) end - def running_or_pending_build_count(force: false) - Rails.cache.fetch(['projects', id, 'running_or_pending_build_count'], force: force) do - builds.running_or_pending.count(:all) - end - end - # Lazy loading of the `pipeline_status` attribute def pipeline_status @pipeline_status ||= Gitlab::Cache::Ci::ProjectPipelineStatus.load_for_project(self) -- cgit v1.2.1