Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#703·whenever

Whenever with capistrano should use symlinked `/current/` instead of `/app_revision/` folder in crontab

Author: StartoufCreated Jun 10, 2017Updated Jun 26, 2025

Consider the following : I have two roles in capistrano, :worker, and :scheduler

My :scheduler role was meant for the machine whose crontab will be updated with whenever. My :worker role is meant for processing background jobs

It turns out to save costs, I decided my scheduler machine could also be a worker to process async jobs. Now two scenarios and the second one is buggy :

  • When I deploy to the :scheduler Role, it will deploy to my whenever-enabled machine and update the crontab, all good.
  • When I deploy to the :worker Role, it will still deploy to my whenever-enabled machine (as it is a worker at the same time) but it WON'T update the crontab (since crontab update is only affiliated to :scheduler. Now what happens is that
    • Not only will whenever use an old app version but
    • after keep_releases deployments, the folder that was referenced by the crontab will no longer exist, causes silent crashes of the scheduler (unless email warnings are enabled to report cron failures)

In order to fix this I would suggest that crontab always uses the symlink /current used by capistrano to maintain the active version. What about it ?

Source: javan/whenever

View original on GitHubView discussion on GitHub