today_ai_weather/config/initializers/schedule_tasks.rb
songtianlun ead795266e refactor: simplify sitemap scheduling process
- Removed conditional check for production environment in
  the initializer to ensure the sitemap refresh worker
  always runs at startup.
- Renamed Sidekiq configuration file from sidekiq.yml to
  sidekiq_scheduler.yml to better reflect its purpose.

These changes streamline the initialization process
for scheduled tasks and enhance the clarity of the
configuration files used in the project.
2025-01-25 11:24:44 +08:00

10 lines
308 B
Ruby

# config/initializers/schedule_tasks.rb
Rails.application.config.after_initialize do
begin
RefreshSitemapWorker.perform_async
Rails.logger.info "Startup task (RefreshSitemapWorker) scheduled successfully"
rescue => e
Rails.logger.error "Error scheduling startup task: #{e.message}"
end
end