Welcome to mirror list, hosted at ThFree Co, Russian Federation.

redis_helpers.rb « redis « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 34ac69236eef917df86baed8fefb1aaa00e1e183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

module RedisHelpers
  Gitlab::Redis::ALL_CLASSES.each do |instance_class|
    define_method("redis_#{instance_class.store_name.underscore}_cleanup!") do
      instance_class.with(&:flushdb)
    end
  end

  # 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
end