From fa40e1bc22babdd77545ef1a6db7a647fee64023 Mon Sep 17 00:00:00 2001 From: antoalconti Date: Tue, 22 Oct 2024 18:41:45 +0200 Subject: [PATCH] Fix redis instance --- config/initializers/rails_performance.rb | 8 ++++++-- config/initializers/sidekiq.rb | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/config/initializers/rails_performance.rb b/config/initializers/rails_performance.rb index 37f468519..78f72cff2 100644 --- a/config/initializers/rails_performance.rb +++ b/config/initializers/rails_performance.rb @@ -1,8 +1,12 @@ if defined?(RailsPerformance) RailsPerformance.setup do |config| - config.redis = Redis.new(url: ENV.fetch('REDIS_PERFORMANCE_URL') { 'redis://localhost:6379/1' }) + config.redis = Redis.new( + url: ENV.fetch('REDIS_PERFORMANCE_URL') { 'redis://localhost:6379/1' }, + ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE } + ) config.duration = 4.hours - config.enabled = true + config.enabled = true + if Rails.env.production? config.http_basic_authentication_enabled = true config.http_basic_authentication_user_name = ENV.fetch('PERFORMANCE_USERNAME') diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 60898d9d7..91a9485fd 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,9 +1,19 @@ Sidekiq.configure_client do |config| - config.redis = { url: ENV.fetch('REDIS_URL') { 'redis://localhost:6379/1' }, size: 1, network_timeout: 5 } + config.redis = { + url: ENV.fetch('REDIS_URL') { 'redis://localhost:6379/1' }, + size: 1, + network_timeout: 5, + ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE } + } end Sidekiq.configure_server do |config| - config.redis = { url: ENV.fetch('REDIS_URL') { 'redis://localhost:6379/1' }, size: 12, network_timeout: 5 } + config.redis = { + url: ENV.fetch('REDIS_URL') { 'redis://localhost:6379/1' }, + size: 12, + network_timeout: 5, + ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE } + } end Sidekiq::Extensions.enable_delay!