Deployment disrupting an in progress cron job

We have cron jobs that run on our server (we are NOT currently using railways cron jobs). What happens if there is a deploy while the cron job is running? These are important jobs and we dont want to lose them. What is the best way to handle this?
6 Replies
Percy
Percy6mo ago
Project ID: 98440440-5311-4573-a36c-07af5ac1c8d9
Cara Kessler
Cara Kessler6mo ago
98440440-5311-4573-a36c-07af5ac1c8d9
Brody
Brody6mo ago
railway will send a sigterm signal and then wait 3 seconds before it terminates the container, unfortunately this 3 second window is not configurable
Cara Kessler
Cara Kessler6mo ago
interesting. @Brody - so what is the best way to handle persistence of important jobs?
Brody
Brody6mo ago
if these jobs are longer than 3 seconds, i honestly dont know if there is a good way to go about it. there is the RAILWAY_DEPLOYMENT_OVERLAP_SECONDS variable https://docs.railway.app/reference/variables#user-provided-configuration-variables but i dont think that sends sigterm any later or waits any longer, you would have to experiment there
joe
joe5mo ago
maybe put them in a separate service if necessary/applicable