diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 21:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 21:09:21 +0300 |
commit | 43e3dc2f95a25c600e08f65d4f1c406a1a63ed3d (patch) | |
tree | db5c72020c7c8916020c8aff7c1b7128028d650b /lib/gitlab/repository_cache_adapter.rb | |
parent | 2c89e169769ead722394a79ed67fcd08e96863dd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/repository_cache_adapter.rb')
-rw-r--r-- | lib/gitlab/repository_cache_adapter.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/repository_cache_adapter.rb b/lib/gitlab/repository_cache_adapter.rb index b2dc92ce010..304f53b58c4 100644 --- a/lib/gitlab/repository_cache_adapter.rb +++ b/lib/gitlab/repository_cache_adapter.rb @@ -132,6 +132,11 @@ module Gitlab raise NotImplementedError end + # RepositoryHashCache to be used. Should be overridden by the including class + def redis_hash_cache + raise NotImplementedError + end + # List of cached methods. Should be overridden by the including class def cached_methods raise NotImplementedError @@ -215,6 +220,7 @@ module Gitlab end expire_redis_set_method_caches(methods) + expire_redis_hash_method_caches(methods) expire_request_store_method_caches(methods) end @@ -234,6 +240,10 @@ module Gitlab methods.each { |name| redis_set_cache.expire(name) } end + def expire_redis_hash_method_caches(methods) + methods.each { |name| redis_hash_cache.delete(name) } + end + # All cached repository methods depend on the existence of a Git repository, # so if the repository doesn't exist, we already know not to call it. def fallback_early?(method_name) |