songtianlun
40631fe95b
- 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.
5 lines
177 B
Ruby
5 lines
177 B
Ruby
# config/initializers/schedule_tasks.rb
|
|
Rails.application.config.after_initialize do
|
|
RefreshSitemapWorker.perform_async unless Rails.env.production? && ENV["RAILS_BUILD"]
|
|
end
|