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
2d05de7a
Commit
2d05de7a
authored
May 31, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache project build count. Closes #18032
parent
81621e46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
.vagrant_enabled
.vagrant_enabled
+0
-0
app/models/project.rb
app/models/project.rb
+6
-0
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+9
-0
No files found.
.vagrant_enabled
0 → 100644
View file @
2d05de7a
app/models/project.rb
View file @
2d05de7a
...
@@ -1011,4 +1011,10 @@ class Project < ActiveRecord::Base
...
@@ -1011,4 +1011,10 @@ class Project < ActiveRecord::Base
update_attribute
(
:pending_delete
,
true
)
update_attribute
(
:pending_delete
,
true
)
end
end
def
running_or_pending_build_count
Rails
.
cache
.
fetch
([
'projects'
,
id
,
'running_or_pending_build_count'
],
expires_in:
60
)
do
builds
.
running_or_pending
.
count
(
:all
)
end
end
end
end
app/views/layouts/nav/_project.html.haml
View file @
2d05de7a
...
@@ -52,6 +52,15 @@
...
@@ -52,6 +52,15 @@
=
icon
(
'ship fw'
)
=
icon
(
'ship fw'
)
%span
%span
Pipelines
Pipelines
%span
.badge.count.ci_counter
=
number_with_delimiter
(
@project
.
ci_commits
.
running_or_pending
.
count
)
-
if
project_nav_tab?
:builds
=
nav_link
(
controller:
%w(builds)
)
do
=
link_to
project_builds_path
(
@project
),
title:
'Builds'
,
class:
'shortcuts-builds'
do
=
icon
(
'cubes fw'
)
%span
Builds
%span
.badge.count.builds_counter
=
number_with_delimiter
(
@project
.
running_or_pending_build_count
)
-
if
project_nav_tab?
:container_registry
-
if
project_nav_tab?
:container_registry
=
nav_link
(
controller:
%w(container_registry)
)
do
=
nav_link
(
controller:
%w(container_registry)
)
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