I have a cron running and wanna know what ways I have to release new version of it without impacting any execution of the cron while deploying the changes. I am using node-cron library (but my question is agnostic of the underlying library tbh) and the cron is doing a couple of calls to gather data from DB, call an endpoint and update some rows. How can I make sure a deploy of a newer version of this cron doesn't kill the process right before updating all the tables?
I have checked other resources online but couldn't find anything really useful as they mention changing the execution plan of the cron before deployment. This would work, but it is too intrusive for my taste. I would want to have the option to setup this in a deployment script or something similar and I want some guidance how to do that