From 84aa01b3b5db4163233bd8c7723d4bf5d9ced056 Mon Sep 17 00:00:00 2001 From: Ryunosuke Sato Date: Mon, 21 Oct 2024 23:49:08 +0900 Subject: [PATCH] Fix SSL Error since Redis 7.0.15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the following update, SSL connection has been required. ``` heroku-redis: Update REDIS by heroku-redis Oct 16 at 5:30 AM · v714 · Roll back to here ``` However, Heroku requires verify mode is none. - https://devcenter.heroku.com/articles/connecting-heroku-redis#connecting-in-ruby - https://help.heroku.com/HC0F8CUS/heroku-key-value-store-connection-issues --- app/models/daily_mail_scheduler.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/models/daily_mail_scheduler.rb b/app/models/daily_mail_scheduler.rb index 16a26e2..8ee3023 100644 --- a/app/models/daily_mail_scheduler.rb +++ b/app/models/daily_mail_scheduler.rb @@ -64,9 +64,17 @@ def scheduled_users private def redis - @redis ||= begin - RedisClient.config(url: Settings.redis_url).new_client - end + @redis ||= + begin + config = RedisClient.config( + url: Settings.redis_url, + ssl_params: { + verify_mode: OpenSSL::SSL::VERIFY_NONE + } + ) + + config.new_client + end end def status_for_user(user)