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
Percy5d ago
Project ID: N/A
tansan
tansan5d ago
N?A
BillyDotWS
BillyDotWS5d 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
BillyDotWS5d ago
to disconnect auto deploy from github: https://i.imgur.com/MmTp1jg.png
Imgur
tansan
tansan5d ago
Ooo okay these are some good ideas I can look more into that
Brody
Brody5d ago
question, how long could a job take?
tansan
tansan4d ago
Usually a few hours
Brody
Brody4d ago
gotcha
Want results from more Discord servers?
Add your server