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: f27d873eb318ae05563b310a2e8a3ec35e4fe256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

module RedisHelpers
  # config/README.md

  # Usage: performance enhancement
  def redis_cache_cleanup!
    Gitlab::Redis::Cache.with(&:flushdb)
  end

  # Usage: SideKiq, Mailroom, CI Runner, Workhorse, push services
  def redis_queues_cleanup!
    Gitlab::Redis::Queues.with(&:flushdb)
  end

  # Usage: session state, rate limiting
  def redis_shared_state_cleanup!
    Gitlab::Redis::SharedState.with(&:flushdb)
  end

  # Usage: CI trace chunks
  def redis_trace_chunks_cleanup!
    Gitlab::Redis::TraceChunks.with(&:flushdb)
  end

  # Usage: rate limiting state (for Rack::Attack)
  def redis_rate_limiting_cleanup!
    Gitlab::Redis::RateLimiting.with(&:flushdb)
  end

  # Usage: session state
  def redis_sessions_cleanup!
    Gitlab::Redis::Sessions.with(&:flushdb)
  end
end