Commit f12ee2a2 authored by Kamil Trzciński's avatar Kamil Trzciński

Remove unused running_or_pending_build_count

parent 3571b97e
...@@ -403,7 +403,6 @@ module Ci ...@@ -403,7 +403,6 @@ module Ci
project.execute_hooks(build_data.dup, :job_hooks) project.execute_hooks(build_data.dup, :job_hooks)
project.execute_services(build_data.dup, :job_hooks) project.execute_services(build_data.dup, :job_hooks)
PagesService.new(build_data).execute PagesService.new(build_data).execute
project.running_or_pending_build_count(force: true)
end end
def browsable_artifacts? def browsable_artifacts?
......
...@@ -1649,12 +1649,6 @@ class Project < ActiveRecord::Base ...@@ -1649,12 +1649,6 @@ class Project < ActiveRecord::Base
import_state.update_column(:jid, nil) import_state.update_column(:jid, nil)
end 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 # Lazy loading of the `pipeline_status` attribute
def pipeline_status def pipeline_status
@pipeline_status ||= Gitlab::Cache::Ci::ProjectPipelineStatus.load_for_project(self) @pipeline_status ||= Gitlab::Cache::Ci::ProjectPipelineStatus.load_for_project(self)
......
---
title: Remove unused running_or_pending_build_count
merge_request:
author:
type: performance
...@@ -32,8 +32,6 @@ describe 'User browses a job', :js do ...@@ -32,8 +32,6 @@ describe 'User browses a job', :js do
page.within('.erased') do page.within('.erased') do
expect(page).to have_content('Job has been erased') expect(page).to have_content('Job has been erased')
end end
expect(build.project.running_or_pending_build_count).to eq(build.project.builds.running_or_pending.count(:all))
end end
context 'with a failed job' do context 'with a failed job' do
......
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