From a39f7b30c5d5fa40408ad572ddbbcbfbe50d8f95 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 23 Feb 2016 12:27:34 +0100 Subject: [PATCH] Move Repository#expire_all_caches to before_delete --- app/models/repository.rb | 15 +++++---------- 1 file 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. -- GitLab