BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
4d9622e7
Commit
4d9622e7
authored
May 31, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Invalidate cache on build change
parent
2d05de7a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
build.rb
app/models/ci/build.rb
+1
-0
project.rb
app/models/project.rb
+5
-1
No files found.
app/models/ci/build.rb
View file @
4d9622e7
...
...
@@ -313,6 +313,7 @@ module Ci
build_data
=
Gitlab
::
BuildDataBuilder
.
build
(
self
)
project
.
execute_hooks
(
build_data
.
dup
,
:build_hooks
)
project
.
execute_services
(
build_data
.
dup
,
:build_hooks
)
project
.
expire_running_or_pending_build_count
end
def
artifacts?
...
...
app/models/project.rb
View file @
4d9622e7
...
...
@@ -1013,8 +1013,12 @@ class Project < ActiveRecord::Base
end
def
running_or_pending_build_count
Rails
.
cache
.
fetch
([
'projects'
,
id
,
'running_or_pending_build_count'
]
,
expires_in:
60
)
do
Rails
.
cache
.
fetch
([
'projects'
,
id
,
'running_or_pending_build_count'
])
do
builds
.
running_or_pending
.
count
(
:all
)
end
end
def
expire_running_or_pending_build_count
Rails
.
cache
.
delete
([
'projects'
,
id
,
'running_or_pending_build_count'
])
end
end
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