about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-04-29 22:43:07 +0200
committerGitHub <noreply@github.com>2022-04-29 22:43:07 +0200
commit7b0fe4aef97c6a5f73a03146b669a415f396799c (patch)
tree328a1117bf021f1ffc0e126e9563f71b31862f1e /config/initializers
parent6476f7e4da4da7c353d497aae5a86fc3909ce532 (diff)
Fix opening and closing Redis connections instead of using a pool (#18171)
* Fix opening and closing Redis connections instead of using a pool

* Fix Redis connections not being returned to the pool in CLI commands
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/stoplight.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/config/initializers/stoplight.rb b/config/initializers/stoplight.rb
index d9ebca76c..8c3c5755a 100644
--- a/config/initializers/stoplight.rb
+++ b/config/initializers/stoplight.rb
@@ -1,4 +1,6 @@
 require 'stoplight'
 
-Stoplight::Light.default_data_store = Stoplight::DataStore::Redis.new(RedisConfiguration.new.connection)
-Stoplight::Light.default_notifiers  = [Stoplight::Notifier::Logger.new(Rails.logger)]
+Rails.application.reloader.to_prepare do
+  Stoplight::Light.default_data_store = Stoplight::DataStore::Redis.new(RedisConfiguration.new.connection)
+  Stoplight::Light.default_notifiers  = [Stoplight::Notifier::Logger.new(Rails.logger)]
+end