fix: correct conditional for sitemap refresh

- Update the condition to check for 'RAILS_BUILD' environment variable
- Allow RefreshSitemapWorker to run in development/test environments

This change clarifies the logic for executing the sitemap refresh worker by
inverting the condition to allow it to run when 'RAILS_BUILD' is not set,
ensuring proper functionality during development and testing phases.
This commit is contained in:
songtianlun 2025-01-25 11:01:29 +08:00
parent 40631fe95b
commit 1f35664590

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 Rails.env.production? && ENV["RAILS_BUILD"] RefreshSitemapWorker.perform_async unless Rails.env.production? && !ENV["RAILS_BUILD"]
end end