Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
f12ee2a2
Commit
f12ee2a2
authored
Jun 04, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused running_or_pending_build_count
parent
3571b97e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
9 deletions
+5
-9
app/models/ci/build.rb
app/models/ci/build.rb
+0
-1
app/models/project.rb
app/models/project.rb
+0
-6
changelogs/unreleased/remove-unused-query-in-hooks.yml
changelogs/unreleased/remove-unused-query-in-hooks.yml
+5
-0
spec/features/projects/jobs/user_browses_job_spec.rb
spec/features/projects/jobs/user_browses_job_spec.rb
+0
-2
No files found.
app/models/ci/build.rb
View file @
f12ee2a2
...
...
@@ -403,7 +403,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
browsable_artifacts?
...
...
app/models/project.rb
View file @
f12ee2a2
...
...
@@ -1649,12 +1649,6 @@ class Project < ActiveRecord::Base
import_state
.
update_column
(
: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
)
...
...
changelogs/unreleased/remove-unused-query-in-hooks.yml
0 → 100644
View file @
f12ee2a2
---
title
:
Remove unused running_or_pending_build_count
merge_request
:
author
:
type
:
performance
spec/features/projects/jobs/user_browses_job_spec.rb
View file @
f12ee2a2
...
...
@@ -32,8 +32,6 @@ describe 'User browses a job', :js do
page
.
within
(
'.erased'
)
do
expect
(
page
).
to
have_content
(
'Job has been erased'
)
end
expect
(
build
.
project
.
running_or_pending_build_count
).
to
eq
(
build
.
project
.
builds
.
running_or_pending
.
count
(
:all
))
end
context
'with a failed job'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment