From 40631fe95b6687c5847f041289377024dacd413e Mon Sep 17 00:00:00 2001 From: songtianlun Date: Sat, 25 Jan 2025 10:56:13 +0800 Subject: [PATCH] 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. --- config/initializers/schedule_tasks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/schedule_tasks.rb b/config/initializers/schedule_tasks.rb index 40e6e6d..5089e5c 100644 --- a/config/initializers/schedule_tasks.rb +++ b/config/initializers/schedule_tasks.rb @@ -1,4 +1,4 @@ # config/initializers/schedule_tasks.rb Rails.application.config.after_initialize do - RefreshSitemapWorker.perform_async unless ENV["RAILS_BUILD"] + RefreshSitemapWorker.perform_async unless Rails.env.production? && ENV["RAILS_BUILD"] end