about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2022-04-29 09:20:51 -0500
committerStarfall <us@starfall.systems>2022-04-29 09:20:51 -0500
commit4eb291e5db6114c8aa564f0c9e7f04d13805b5cc (patch)
tree1a6affcf635974ccf6d0f650a3bbe2be75c7929e /config/initializers
parentbcaacc42334d75bd361f330989041a9beba101a9 (diff)
parent252deefe3433d0cedafd973becd0d85b5182eb49 (diff)
Merge remote-tracking branch 'glitch/main'
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/redis.rb14
-rw-r--r--config/initializers/sidekiq.rb4
-rw-r--r--config/initializers/stoplight.rb2
3 files changed, 3 insertions, 17 deletions
diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb
deleted file mode 100644
index 7573fc9f7..000000000
--- a/config/initializers/redis.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-redis_connection = Redis.new(
-  url: ENV['REDIS_URL'],
-  driver: :hiredis
-)
-
-namespace = ENV.fetch('REDIS_NAMESPACE') { nil }
-
-if namespace
-  Redis.current = Redis::Namespace.new(namespace, redis: redis_connection)
-else
-  Redis.current = redis_connection
-end
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 19a705ce8..c1327053d 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -1,12 +1,12 @@
 # frozen_string_literal: true
 
-require_relative '../../lib/sidekiq_error_handler'
+require_relative '../../lib/mastodon/sidekiq_middleware'
 
 Sidekiq.configure_server do |config|
   config.redis = REDIS_SIDEKIQ_PARAMS
 
   config.server_middleware do |chain|
-    chain.add SidekiqErrorHandler
+    chain.add Mastodon::SidekiqMiddleware
   end
 
   config.server_middleware do |chain|
diff --git a/config/initializers/stoplight.rb b/config/initializers/stoplight.rb
index 7384b2e9a..d9ebca76c 100644
--- a/config/initializers/stoplight.rb
+++ b/config/initializers/stoplight.rb
@@ -1,4 +1,4 @@
 require 'stoplight'
 
-Stoplight::Light.default_data_store = Stoplight::DataStore::Redis.new(Redis.current)
+Stoplight::Light.default_data_store = Stoplight::DataStore::Redis.new(RedisConfiguration.new.connection)
 Stoplight::Light.default_notifiers  = [Stoplight::Notifier::Logger.new(Rails.logger)]