a year ago
We have a service on Railway that receives http requests that then trigger long-ish (up to 5 minutes) running jobs. Whenever we have a new autodeploy from github, if any jobs are running on the instance, it'll get shut down and their progress gets lost. We have a queue in front of this so the jobs still get run but they're quite expensive so we ideally don't want them to run twice. We were wondering if something like this following is possible:
New Deployment gets created
New requests are routed to this deployment
Railway waits for the other deployment to "gracefully" shutdown for a few minutes
3 Replies
a year ago
Hello,
This absolutely can be done!
1. Yep
2. This happens by default.
3. Adjust the RAILWAY_DEPLOYMENT_DRAINING_SECONDS variable to however long you need the old deployment to stay running for.
https://docs.railway.com/reference/variables#user-provided-configuration-variables
Best,
Brody
Status changed to Awaiting User Response Railway • 12 months ago
a year ago
Thanks! Didn't see those variables before really appreciate it!
Status changed to Awaiting Railway Response Railway • 12 months ago
Status changed to Awaiting User Response Railway • 12 months ago
6 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 6 months ago
