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
iv
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
app/models/ci/build.rb
app/models/ci/build.rb
+1
-0
app/models/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
...
@@ -313,6 +313,7 @@ module Ci
build_data
=
Gitlab
::
BuildDataBuilder
.
build
(
self
)
build_data
=
Gitlab
::
BuildDataBuilder
.
build
(
self
)
project
.
execute_hooks
(
build_data
.
dup
,
:build_hooks
)
project
.
execute_hooks
(
build_data
.
dup
,
:build_hooks
)
project
.
execute_services
(
build_data
.
dup
,
:build_hooks
)
project
.
execute_services
(
build_data
.
dup
,
:build_hooks
)
project
.
expire_running_or_pending_build_count
end
end
def
artifacts?
def
artifacts?
...
...
app/models/project.rb
View file @
4d9622e7
...
@@ -1013,8 +1013,12 @@ class Project < ActiveRecord::Base
...
@@ -1013,8 +1013,12 @@ class Project < ActiveRecord::Base
end
end
def
running_or_pending_build_count
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
)
builds
.
running_or_pending
.
count
(
:all
)
end
end
end
end
def
expire_running_or_pending_build_count
Rails
.
cache
.
delete
([
'projects'
,
id
,
'running_or_pending_build_count'
])
end
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