diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-02-23 12:27:34 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-02-23 12:27:34 +0100 |
commit | a39f7b30c5d5fa40408ad572ddbbcbfbe50d8f95 (patch) | |
tree | 6de116422237f68915333a804df81af0dfbb7985 | |
parent | ff28a7cc3687485ee138d4616a56ba1548a03e7c (diff) | |
download | gitlab-ce-a39f7b30c5d5fa40408ad572ddbbcbfbe50d8f95.tar.gz |
Move Repository#expire_all_caches to before_delete
-rw-r--r-- | app/models/repository.rb | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index e3769451001..38438959d40 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -245,15 +245,6 @@ class Repository expire_emptiness_caches if empty? 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) # 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 @@ -310,7 +301,11 @@ class Repository # Runs code just before a repository is deleted. def before_delete # 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 # Runs code just before the HEAD of a repository is changed. |