DEV: Pause Sidekiq before readonly mode during PG failover.

DEV: Pause Sidekiq before readonly mode during PG failover.

diff --git a/config/initializers/002-rails_failover.rb b/config/initializers/002-rails_failover.rb
index 0bfa3d9..8c03632 100644
--- a/config/initializers/002-rails_failover.rb
+++ b/config/initializers/002-rails_failover.rb
@@ -33,8 +33,8 @@ if defined?(RailsFailover::ActiveRecord)
   RailsFailover::ActiveRecord.on_failover do
     if RailsMultisite::ConnectionManagement.current_db == RailsMultisite::ConnectionManagement::DEFAULT
       RailsMultisite::ConnectionManagement.each_connection do
-        Discourse.enable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
         Sidekiq.pause!("pg_failover") if !Sidekiq.paused?
+        Discourse.enable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
       end
     end
   end

GitHub sha: df66a559