summaryrefslogtreecommitdiff
path: root/spec/support/redis/redis_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/redis/redis_helpers.rb')
-rw-r--r--spec/support/redis/redis_helpers.rb34
1 files changed, 4 insertions, 30 deletions
diff --git a/spec/support/redis/redis_helpers.rb b/spec/support/redis/redis_helpers.rb
index 90c15dea1f8..34ac69236ee 100644
--- a/spec/support/redis/redis_helpers.rb
+++ b/spec/support/redis/redis_helpers.rb
@@ -1,36 +1,10 @@
# 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)
+ 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