Let's suppose that we have some long-lasting cronjob/worker, running or some production servers. We have new application code release and ready to deploy it into production.
What should we do with this cronjob/workers?
- Wait for cronjob/worker complete it's job and do not start next on until deployment is over + restrict all other cronjobs/workers start until deployment is over
- Implement SIGTERM handlers in cronjob/worker & send SIGTERM to all nessesary processes before deploy? (sometimes it is rather difficult to implement this kind of hanglers)
- Split long lasting cronjob/worker into parts, push into queue and forget about this problem?
- Any ideas?