Skip to content

Commit

Permalink
DEV: Pausing Sidekiq is multisite aware.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgxworld committed Jun 4, 2020
1 parent 8e1681d commit 54f79ea
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions config/initializers/002-rails_failover.rb
Expand Up @@ -15,17 +15,15 @@
RailsFailover::ActiveRecord.on_failover do
RailsMultisite::ConnectionManagement.each_connection do
Discourse.enable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
Sidekiq.pause!("pg_failover") if !Sidekiq.paused?
end

Sidekiq.pause!("pg_failover") if !Sidekiq.paused?
end

RailsFailover::ActiveRecord.on_fallback do
RailsMultisite::ConnectionManagement.each_connection do
Discourse.disable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
Sidekiq.unpause! if Sidekiq.paused?
end

Sidekiq.unpause! if Sidekiq.pause?
end

module Discourse
Expand Down

0 comments on commit 54f79ea

Please sign in to comment.