2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
module RedisHelpers
|
|
|
|
# config/README.md
|
|
|
|
|
|
|
|
# Usage: performance enhancement
|
|
|
|
def redis_cache_cleanup!
|
2021-09-30 23:02:18 +05:30
|
|
|
Gitlab::Redis::Cache.with(&:flushdb)
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
# Usage: SideKiq, Mailroom, CI Runner, Workhorse, push services
|
|
|
|
def redis_queues_cleanup!
|
2021-09-30 23:02:18 +05:30
|
|
|
Gitlab::Redis::Queues.with(&:flushdb)
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
# Usage: session state, rate limiting
|
|
|
|
def redis_shared_state_cleanup!
|
2021-09-30 23:02:18 +05:30
|
|
|
Gitlab::Redis::SharedState.with(&:flushdb)
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|
2021-09-04 01:27:46 +05:30
|
|
|
|
|
|
|
# Usage: CI trace chunks
|
|
|
|
def redis_trace_chunks_cleanup!
|
2021-09-30 23:02:18 +05:30
|
|
|
Gitlab::Redis::TraceChunks.with(&:flushdb)
|
2021-09-04 01:27:46 +05:30
|
|
|
end
|
2018-10-15 14:42:47 +05:30
|
|
|
end
|