debian-mirror-gitlab/spec/support/redis/redis_helpers.rb

17 lines
459 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-10-15 14:42:47 +05:30
module RedisHelpers
2022-10-11 01:57:18 +05:30
Gitlab::Redis::ALL_CLASSES.each do |instance_class|
define_method("redis_#{instance_class.store_name.underscore}_cleanup!") do
instance_class.with(&:flushdb)
end
2021-11-18 22:05:49 +05:30
end
2022-01-26 12:08:38 +05:30
# Usage: reset cached instance config
def redis_clear_raw_config!(instance_class)
instance_class.remove_instance_variable(:@_raw_config)
rescue NameError
# raised if @_raw_config was not set; ignore
end
2018-10-15 14:42:47 +05:30
end