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
eb122e40
Commit
eb122e40
authored
Jul 20, 2016
by
Paco Guzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expire tags/branches repo cache before delete a repository
parent
79b02e40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
app/models/repository.rb
app/models/repository.rb
+5
-0
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+48
-0
No files found.
app/models/repository.rb
View file @
eb122e40
...
...
@@ -392,6 +392,11 @@ class Repository
expire_cache
if
exists?
# expire cache that don't depend on repository data (when expiring)
expire_tags_cache
expire_tag_count_cache
expire_branches_cache
expire_branch_count_cache
expire_root_ref_cache
expire_emptiness_caches
expire_exists_cache
...
...
spec/models/repository_spec.rb
View file @
eb122e40
...
...
@@ -749,6 +749,30 @@ describe Repository, models: true do
repository
.
before_delete
end
it
'flushes the tags cache'
do
expect
(
repository
).
to
receive
(
:expire_tags_cache
)
repository
.
before_delete
end
it
'flushes the tag count cache'
do
expect
(
repository
).
to
receive
(
:expire_tag_count_cache
)
repository
.
before_delete
end
it
'flushes the branches cache'
do
expect
(
repository
).
to
receive
(
:expire_branches_cache
)
repository
.
before_delete
end
it
'flushes the branch count cache'
do
expect
(
repository
).
to
receive
(
:expire_branch_count_cache
)
repository
.
before_delete
end
it
'flushes the root ref cache'
do
expect
(
repository
).
to
receive
(
:expire_root_ref_cache
)
...
...
@@ -779,6 +803,30 @@ describe Repository, models: true do
repository
.
before_delete
end
it
'flushes the tags cache'
do
expect
(
repository
).
to
receive
(
:expire_tags_cache
)
repository
.
before_delete
end
it
'flushes the tag count cache'
do
expect
(
repository
).
to
receive
(
:expire_tag_count_cache
)
repository
.
before_delete
end
it
'flushes the branches cache'
do
expect
(
repository
).
to
receive
(
:expire_branches_cache
)
repository
.
before_delete
end
it
'flushes the branch count cache'
do
expect
(
repository
).
to
receive
(
:expire_branch_count_cache
)
repository
.
before_delete
end
it
'flushes the root ref cache'
do
expect
(
repository
).
to
receive
(
:expire_root_ref_cache
)
...
...
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