Pause MiniScheduler when Sidekiq is paused.

This commit is contained in:
Guo Xiang Tan 2019-01-18 17:48:00 +08:00
parent 1e5ddb007f
commit ee7ab3e2ec
2 changed files with 6 additions and 2 deletions

View File

@ -202,7 +202,7 @@ GEM
mini_portile2 (2.3.0)
mini_racer (0.2.3)
libv8 (>= 6.3)
mini_scheduler (0.8.1)
mini_scheduler (0.9.0)
mini_sql (0.1.10)
mini_suffix (0.3.0)
ffi (~> 1.9)

View File

@ -24,8 +24,12 @@ MiniScheduler.configure do |config|
DiscourseEvent.trigger(:scheduled_job_ran, stat)
end
config.skip_schedule { Sidekiq.paused? }
config.before_sidekiq_web_request do
RailsMultisite::ConnectionManagement.establish_connection(db: 'default')
RailsMultisite::ConnectionManagement.establish_connection(
db: RailsMultisite::ConnectionManagement::DEFAULT
)
end
end