DEV: Pausing Sidekiq is multisite aware.
This commit is contained in:
parent
8e1681d356
commit
54f79ea3ba
|
@ -15,17 +15,15 @@ if ENV["ACTIVE_RECORD_RAILS_FAILOVER"]
|
||||||
RailsFailover::ActiveRecord.on_failover do
|
RailsFailover::ActiveRecord.on_failover do
|
||||||
RailsMultisite::ConnectionManagement.each_connection do
|
RailsMultisite::ConnectionManagement.each_connection do
|
||||||
Discourse.enable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
Discourse.enable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
||||||
end
|
|
||||||
|
|
||||||
Sidekiq.pause!("pg_failover") if !Sidekiq.paused?
|
Sidekiq.pause!("pg_failover") if !Sidekiq.paused?
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
RailsFailover::ActiveRecord.on_fallback do
|
RailsFailover::ActiveRecord.on_fallback do
|
||||||
RailsMultisite::ConnectionManagement.each_connection do
|
RailsMultisite::ConnectionManagement.each_connection do
|
||||||
Discourse.disable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
Discourse.disable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
||||||
|
Sidekiq.unpause! if Sidekiq.paused?
|
||||||
end
|
end
|
||||||
|
|
||||||
Sidekiq.unpause! if Sidekiq.pause?
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module Discourse
|
module Discourse
|
||||||
|
|
Loading…
Reference in New Issue