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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
a39f7b30
Commit
a39f7b30
authored
Feb 23, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Repository#expire_all_caches to before_delete
parent
ff28a7cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
app/models/repository.rb
app/models/repository.rb
+5
-10
No files found.
app/models/repository.rb
View file @
a39f7b30
...
@@ -245,15 +245,6 @@ class Repository
...
@@ -245,15 +245,6 @@ class Repository
expire_emptiness_caches
if
empty?
expire_emptiness_caches
if
empty?
end
end
# Expires _all_ caches, including those that would normally only be expired
# under specific conditions.
def
expire_all_caches!
expire_cache
expire_root_ref_cache
expire_emptiness_caches
expire_has_visible_content_cache
end
def
expire_branch_cache
(
branch_name
=
nil
)
def
expire_branch_cache
(
branch_name
=
nil
)
# When we push to the root branch we have to flush the cache for all other
# When we push to the root branch we have to flush the cache for all other
# branches as their statistics are based on the commits relative to the
# branches as their statistics are based on the commits relative to the
...
@@ -310,7 +301,11 @@ class Repository
...
@@ -310,7 +301,11 @@ class Repository
# Runs code just before a repository is deleted.
# Runs code just before a repository is deleted.
def
before_delete
def
before_delete
# FIXME: a repository not existing shouldn't prevent us from flushing caches.
# FIXME: a repository not existing shouldn't prevent us from flushing caches.
expire_all_caches!
if
exists?
if
exists?
expire_cache
expire_root_ref_cache
expire_emptiness_caches
end
end
end
# Runs code just before the HEAD of a repository is changed.
# Runs code just before the HEAD of a repository is changed.
...
...
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