R
Railway2mo ago
tansan

Workers and auto-deploy

1. Is there a way to disable auto deploy? I have workers that are in a middle of a job that I don't want disrupted until its finished with a job before deploying a new version. 2. Is there a way "trigger" a job? Ex, I have a task that I only need to run once in a while so currently I'm just remove the instance and re-deploying
8 Replies
Percy
Percy2mo ago
Project ID: N/A
tansan
tansanOP2mo ago
N?A
BillyDotWS
BillyDotWS2mo ago
what is your current deploy source? github? If so: Unlink the github repository and setup a github action instead: https://github.com/bervProject/railway-deploy (externally supported, not railway official). Then make it only trigger on a specific branch/if specific conditions are met Example: send something (e.g. api request) to your worker controller to pause new consumption, then poll in the github action until the controller says the deployment is safe (no jobs running) Once it deploys, another action, un-pauses the controller (which allows it to consume the remaining jobs). Look at the GA docs, that'd be the best idea if you're wanting non-default/special behaviour. --
Is there a way "trigger" a job? Ex, I have a task that I only need to run once in a while so currently I'm just remove the instance and re-deploying
What's the requirement? Is this happening, for example every sunday, or at a specific day/time? or are you looking for more sporadic/on demand? If predictable - use cron jobs If on demand - you'd integrate with the API [https://docs.railway.app/reference/public-api] and have whatever needs to run the task call it
BillyDotWS
BillyDotWS2mo ago
to disconnect auto deploy from github: https://i.imgur.com/MmTp1jg.png
Imgur
tansan
tansanOP2mo ago
Ooo okay these are some good ideas I can look more into that
Brody
Brody2mo ago
question, how long could a job take?
tansan
tansanOP2mo ago
Usually a few hours
Brody
Brody2mo ago
gotcha
Want results from more Discord servers?
Add your server