Skip to content

Commit 4bbd90c

Browse files
committed
give it another shot
1 parent 7594870 commit 4bbd90c

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

config/application.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ class Application < Rails::Application
2828
config.i18n.default_locale = :nl
2929
config.i18n.fallbacks = [:nl]
3030

31+
# Build Redis URL from environment variables
3132
redis_url = ENV['REDIS_URL']
32-
redis_url ||= begin
33-
cable_cfg = Rails.application.config_for(:cable)
34-
cable_cfg['url'] if cable_cfg.present?
35-
rescue StandardError
36-
nil
33+
if redis_url.blank? && ENV['REDIS_HOST'].present?
34+
password = ENV['REDIS_PASSWORD'].present? ? ":#{ENV['REDIS_PASSWORD']}@" : ':'
35+
redis_url = "redis://#{password}#{ENV['REDIS_HOST']}:#{ENV.fetch('REDIS_PORT', 6379)}/1"
3736
end
3837

3938
if redis_url.present?

0 commit comments

Comments
 (0)