FIX: Ensure that scheduled jobs are loaded. (#8183)

In development, the scheduled jobs are loaded lazily and MiniScheduler
cannot discover them (/sidekiq/scheduler does not show any jobs).
This commit is contained in:
Dan Ungureanu 2019-10-14 12:14:16 +03:00 committed by GitHub
parent 519fe290e3
commit 5b84307774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,13 @@
# frozen_string_literal: true # frozen_string_literal: true
# Ensure that scheduled jobs are loaded before mini_scheduler is configured.
if Rails.env == "development"
require "jobs/base"
Dir.glob("#{Rails.root}/app/jobs/scheduled/*.rb") do |f|
load(f)
end
end
require "sidekiq/pausable" require "sidekiq/pausable"
Sidekiq.configure_client do |config| Sidekiq.configure_client do |config|