- Updated schedule_tasks.rb to include RAILS_BUILD check
- Improved application startup behavior in development mode
This change ensures the startup task does not run unnecessarily in development environment, reducing application startup time and resources usage.
- Schedule RefreshSitemapWorker after initialization
- Implement error handling for scheduling task
- Use Rails cache to prevent multiple tasks running simultaneously
This commit introduces a mechanism that schedules the
RefreshSitemapWorker to run once after the application starts
in production. It ensures that the task does not run
multiple times concurrently by using a cache key.
Error handling is included to log any failures
in scheduling the task, improving overall reliability.