diff options
author | Michael Kozono <mkozono@gmail.com> | 2018-09-25 10:13:05 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2018-09-27 18:22:37 -0700 |
commit | 87a1ba1488a6591569ecaf1131094fefd2163fd0 (patch) | |
tree | 719987472573a26b0308b09a0c26f516246a1d03 /lib/gitlab/repository_cache_adapter.rb | |
parent | 3640292bf2ef822c8e2394fa2397b1b7d04e9891 (diff) | |
download | gitlab-ce-87a1ba1488a6591569ecaf1131094fefd2163fd0.tar.gz |
Expire RequestStore cache properly
Diffstat (limited to 'lib/gitlab/repository_cache_adapter.rb')
-rw-r--r-- | lib/gitlab/repository_cache_adapter.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/repository_cache_adapter.rb b/lib/gitlab/repository_cache_adapter.rb index bd0e51cbfe5..160e3d13b43 100644 --- a/lib/gitlab/repository_cache_adapter.rb +++ b/lib/gitlab/repository_cache_adapter.rb @@ -136,6 +136,8 @@ module Gitlab clear_memoization(memoizable_name(name)) end + + expire_request_store_method_caches(methods) end private @@ -144,6 +146,12 @@ module Gitlab "#{name.to_s.tr('?!', '')}" end + def expire_request_store_method_caches(methods) + methods.each do |name| + request_store_cache.expire(name) + end + 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) |