Commit 938284d2 authored by Ahmad Sherif's avatar Ahmad Sherif
Browse files

Merge branch 'sh-support-google-cloud-memorystore' into 'master'

Add support for Google Cloud Memorystore

See merge request gitlab-org/gitlab-monitor!85
parents fce00320 75bfc7e5
Pipeline #106418 passed with stage
in 25 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