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
27b9f64e
Commit
27b9f64e
authored
Apr 07, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expire caches after project creation to ensure a consistent state
Closes #14961
parent
8f094531
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
app/models/repository.rb
app/models/repository.rb
+2
-0
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+13
-0
No files found.
app/models/repository.rb
View file @
27b9f64e
...
...
@@ -331,6 +331,8 @@ class Repository
# Runs code after a repository has been created.
def
after_create
expire_exists_cache
expire_root_ref_cache
expire_emptiness_caches
end
# Runs code just before a repository is deleted.
...
...
spec/models/repository_spec.rb
View file @
27b9f64e
...
...
@@ -670,6 +670,19 @@ describe Repository, models: true do
repository
.
after_create
end
it
'flushes the root ref cache'
do
expect
(
repository
).
to
receive
(
:expire_root_ref_cache
)
repository
.
after_create
end
it
'flushes the emptiness caches'
do
expect
(
repository
).
to
receive
(
:expire_emptiness_caches
)
repository
.
after_create
end
end
describe
"#main_language"
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