DEV: Update chat scheduled job loading to match skeleton (#26853)

Followup to e949684fc5, ref https://github.com/discourse/discourse-plugin-skeleton/pull/47
This commit is contained in:
David Taylor 2024-05-02 19:20:00 +01:00 committed by GitHub
parent e949684fc5
commit f28742e597
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,8 +8,9 @@ module ::Chat
engine_name PLUGIN_NAME
isolate_namespace Chat
config.autoload_paths << File.join(config.root, "lib")
scheduled_job_dir = "#{config.root}/app/jobs/scheduled"
config.to_prepare do
Rails.autoloaders.main.eager_load_dir("#{Chat::Engine.config.root}/app/jobs/scheduled")
Rails.autoloaders.main.eager_load_dir(scheduled_job_dir) if Dir.exist?(scheduled_job_dir)
end
end