File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments