2021-02-03 21:09:17 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-10-04 12:11:58 +00:00
|
|
|
# We set the instance variable directly to suppress warnings.
|
|
|
|
# We cannot switch to the new behavior until we change all existing `redis.exists` calls to `redis.exists?`.
|
|
|
|
# Some gems also need to be updated
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/340602
|
|
|
|
Redis.instance_variable_set(:@exists_returns_integer, false)
|
|
|
|
|
2021-06-23 03:07:43 +00:00
|
|
|
Redis::Client.prepend(Gitlab::Instrumentation::RedisInterceptor)
|
|
|
|
|
2017-07-11 03:35:47 +00:00
|
|
|
# Make sure we initialize a Redis connection pool before multi-threaded
|
|
|
|
# execution starts by
|
|
|
|
# 1. Sidekiq
|
|
|
|
# 2. Rails.cache
|
|
|
|
# 3. HTTP clients
|
|
|
|
Gitlab::Redis::Cache.with { nil }
|
|
|
|
Gitlab::Redis::Queues.with { nil }
|
|
|
|
Gitlab::Redis::SharedState.with { nil }
|
2021-06-09 06:10:29 +00:00
|
|
|
Gitlab::Redis::TraceChunks.with { nil }
|
2021-09-30 18:11:31 +00:00
|
|
|
Gitlab::Redis::RateLimiting.with { nil }
|
2021-10-15 15:10:09 +00:00
|
|
|
Gitlab::Redis::Sessions.with { nil }
|