Skip to content

Commit 7594870

Browse files
committed
try something
1 parent dab638d commit 7594870

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

config/application.rb

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

31-
config.cache_store = :redis_cache_store, {
32-
url: Rails.application.config_for(:cable)['url'],
33-
pool: { size: ENV.fetch('RAILS_MAX_THREADS', 5).to_i, timeout: 5 }
34-
}
31+
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
37+
end
38+
39+
if redis_url.present?
40+
config.cache_store = :redis_cache_store, {
41+
url: redis_url,
42+
pool: { size: ENV.fetch('RAILS_MAX_THREADS', 5).to_i, timeout: 5 }
43+
}
44+
else
45+
config.cache_store = :memory_store
46+
end
3547
config.active_job.queue_adapter = :sidekiq
3648

3749
config.exceptions_app = routes

0 commit comments

Comments
 (0)