diff options
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) |