fix: alter sitemap refresh condition

- Change the condition to prevent sitemap refresh in production when
  `RAILS_BUILD` is set.
- Ensures that the task only runs in development or non-production
  environments, avoiding potential conflicts or wasted resources.

This change helps to streamline the initialization process and enhances
performance by not triggering unnecessary background tasks.
This commit is contained in:
songtianlun 2025-01-25 10:56:13 +08:00
parent f7c5ae4ee7
commit 40631fe95b

View File

@ -1,4 +1,4 @@
# config/initializers/schedule_tasks.rb # config/initializers/schedule_tasks.rb
Rails.application.config.after_initialize do Rails.application.config.after_initialize do
RefreshSitemapWorker.perform_async unless ENV["RAILS_BUILD"] RefreshSitemapWorker.perform_async unless Rails.env.production? && ENV["RAILS_BUILD"]
end end