From 7b0fe4aef97c6a5f73a03146b669a415f396799c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 29 Apr 2022 22:43:07 +0200 Subject: 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 --- config/initializers/stoplight.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config/initializers') 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 -- cgit