Commit 078b4ff1 authored by Nick Thomas's avatar Nick Thomas

Merge branch '331319-remove-old-set-cache-keys' into 'master'

Remove `old_cache_key` from set caches

See merge request gitlab-org/gitlab!65936
parents 531514f0 b696169d
......@@ -10,11 +10,6 @@ module Gitlab
@expires_in = expires_in
end
# NOTE Remove as part of #331319
def old_cache_key(key)
"#{cache_namespace}:#{key}:set"
end
def cache_key(key)
super(key)
end
......
......@@ -13,11 +13,6 @@ module Gitlab
@expires_in = expires_in
end
# NOTE Remove as part of #331319
def old_cache_key(type)
"#{type}:#{namespace}:set"
end
def cache_key(type)
super("#{type}:#{namespace}")
end
......
......@@ -10,11 +10,6 @@ module Gitlab
@expires_in = expires_in
end
# NOTE Remove as part of https://gitlab.com/gitlab-org/gitlab/-/issues/331319
def old_cache_key(key)
"#{key}:set"
end
def cache_key(key)
"#{cache_namespace}:#{key}:set"
end
......@@ -25,7 +20,6 @@ module Gitlab
with do |redis|
keys_to_expire = keys.map { |key| cache_key(key) }
keys_to_expire += keys.map { |key| old_cache_key(key) } # NOTE Remove as part of #331319
Gitlab::Instrumentation::RedisClusterValidator.allow_cross_slot_commands do
redis.unlink(*keys_to_expire)
......
......@@ -94,12 +94,6 @@ RSpec.describe Gitlab::RepositorySetCache, :clean_gitlab_redis_cache do
expect(cache.read(:foo)).to be_empty
end
it 'expires the old key format' do
expect_any_instance_of(Redis).to receive(:unlink).with(cache.cache_key(:foo), cache.old_cache_key(:foo)) # rubocop:disable RSpec/AnyInstanceOf
subject
end
end
context 'multiple keys' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment