summaryrefslogtreecommitdiff
path: root/app/models/repository.rb
diff options
context:
space:
mode:
authorLinus G Thiel <linus@yesbabyyes.se>2016-10-25 13:14:16 +0200
committerLinus G Thiel <linus@yesbabyyes.se>2016-10-25 13:14:16 +0200
commitcc8ebae527b270ea65d408fa60c2e5c78db5a155 (patch)
tree8c40399b819956a32b916e538bcec94b3f04056d /app/models/repository.rb
parent1ff140ea386d856c526b4797f38b4937e9b26f80 (diff)
parentba27abec815e476481b976175c67273c1cbb6e57 (diff)
downloadgitlab-ce-cc8ebae527b270ea65d408fa60c2e5c78db5a155.tar.gz
Merge branch 'master' into 22743-issue-tooltip-will-not-disappear-going-back-to-previous-page
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb27
1 files changed, 15 insertions, 12 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 1b7f20a2134..4ae9c20726f 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -419,6 +419,17 @@ class Repository
@exists = nil
end
+ # expire cache that doesn't depend on repository data (when expiring)
+ def expire_content_cache
+ expire_tags_cache
+ expire_tag_count_cache
+ expire_branches_cache
+ expire_branch_count_cache
+ expire_root_ref_cache
+ expire_emptiness_caches
+ expire_exists_cache
+ end
+
# Runs code after a repository has been created.
def after_create
expire_exists_cache
@@ -434,14 +445,7 @@ 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
+ expire_content_cache
repository_event(:remove_repository)
end
@@ -473,14 +477,13 @@ class Repository
end
def before_import
- expire_emptiness_caches
- expire_exists_cache
+ expire_content_cache
end
# Runs code after a repository has been forked/imported.
def after_import
- expire_emptiness_caches
- expire_exists_cache
+ expire_content_cache
+ build_cache
end
# Runs code after a new commit has been pushed.