From 69c8f26946a5cdeff09ca8fe410bc11be78c158c Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 21 Jul 2023 14:18:04 +0200 Subject: [PATCH] Add check preventing Sidekiq workers from running with Makara configured (#25850) Co-authored-by: Eugen Rochko --- config/initializers/sidekiq.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 9d2abf0745..b847e65469 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -3,6 +3,11 @@ require_relative '../../lib/mastodon/sidekiq_middleware' Sidekiq.configure_server do |config| + if Rails.configuration.database_configuration.dig('production', 'adapter') == 'postgresql_makara' + STDERR.puts 'ERROR: Database replication is not currently supported in Sidekiq workers. Check your configuration.' + exit 1 + end + config.redis = REDIS_SIDEKIQ_PARAMS config.server_middleware do |chain|