Commit 75bfc7e5 authored by Stan Hu's avatar Stan Hu

Add support for Google Cloud Memorystore

This adds an optional `redis_enable_client` config option that will turn
off the CLIENT command when talking to the Sidekiq API.

Relates to https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4164
parent fce00320
Pipeline #106407 passed with stage
in 35 seconds
......@@ -78,6 +78,7 @@ probes:
- probe_dead
opts:
redis_url: "redis://localhost:6379"
redis_enable_client: true
metrics:
multiple: true
......
......@@ -15,12 +15,7 @@ module GitLab
@metrics = metrics
Sidekiq.configure_client do |config|
config.redis = {
url: opts[:redis_url],
namespace: "resque:gitlab",
connect_timeout: 1,
reconnect_attempts: 0
}
config.redis = redis_options
end
ensure_queue_job_stats_script_loaded
......@@ -110,6 +105,24 @@ module GitLab
private
def redis_options
options = {
url: @opts[:redis_url],
namespace: "resque:gitlab",
connect_timeout: 1,
reconnect_attempts: 0
}
options[:id] = nil unless redis_enable_client?
options
end
def redis_enable_client?
return true if @opts[:redis_enable_client].nil?
@opts[:redis_enable_client]
end
def connected?
@connected ||= begin
Sidekiq.redis do |conn|
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment