diff options
Diffstat (limited to 'lib/gitlab/reactive_cache_set_cache.rb')
-rw-r--r-- | lib/gitlab/reactive_cache_set_cache.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/reactive_cache_set_cache.rb b/lib/gitlab/reactive_cache_set_cache.rb index 14d008c3dfb..609087d8137 100644 --- a/lib/gitlab/reactive_cache_set_cache.rb +++ b/lib/gitlab/reactive_cache_set_cache.rb @@ -10,9 +10,13 @@ module Gitlab @expires_in = expires_in end + def cache_key(key) + "#{cache_type}:#{key}:set" + end + def clear_cache!(key) with do |redis| - keys = read(key).map { |value| "#{cache_type}#{value}" } + keys = read(key).map { |value| "#{cache_type}:#{value}" } keys << cache_key(key) redis.pipelined do @@ -24,7 +28,7 @@ module Gitlab private def cache_type - "#{Gitlab::Redis::Cache::CACHE_NAMESPACE}:" + Gitlab::Redis::Cache::CACHE_NAMESPACE end end end |