summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/repository.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 7a6dfada917..4fecdb3c1ad 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -510,7 +510,7 @@ class Repository
raw_repository.exists?
end
- cache_method :exists?
+ cache_method_asymmetrically :exists?
# We don't need to cache the output of this method because both exists? and
# has_visible_content? are already memoized and cached. There's no guarantee
@@ -1029,6 +1029,10 @@ class Repository
@cache ||= Gitlab::RepositoryCache.new(self)
end
+ def request_store_cache
+ @request_store_cache ||= Gitlab::RepositoryCache.new(self, backend: Gitlab::SafeRequestStore)
+ end
+
def tags_sorted_by_committed_date
tags.sort_by do |tag|
# Annotated tags can point to any object (e.g. a blob), but generally