today_ai_weather/config/initializers/schedule_tasks.rb
songtianlun 40631fe95b 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.
2025-01-25 10:56:13 +08:00

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