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

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: ...@@ -78,6 +78,7 @@ probes:
- probe_dead - probe_dead
opts: opts:
redis_url: "redis://localhost:6379" redis_url: "redis://localhost:6379"
redis_enable_client: true
metrics: metrics:
multiple: true multiple: true
......
...@@ -15,12 +15,7 @@ module GitLab ...@@ -15,12 +15,7 @@ module GitLab
@metrics = metrics @metrics = metrics
Sidekiq.configure_client do |config| Sidekiq.configure_client do |config|
config.redis = { config.redis = redis_options
url: opts[:redis_url],
namespace: "resque:gitlab",
connect_timeout: 1,
reconnect_attempts: 0
}
end end
ensure_queue_job_stats_script_loaded ensure_queue_job_stats_script_loaded
...@@ -110,6 +105,24 @@ module GitLab ...@@ -110,6 +105,24 @@ module GitLab
private 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? def connected?
@connected ||= begin @connected ||= begin
Sidekiq.redis do |conn| 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