How do temporarily disable or pause a cron service
rossfreedman
PROOP

a year ago

How do temporarily disable a cron service? If I delete the schedule, the deployment fails. If if change my code, it also changes production? Is there an easy way to pause a cron service?

Solved$20 Bounty

Pinned Solution

a year ago

Hey, I would just remove the connected source (for example your GitHub repository) from your service and remove the cron schedule (plus active deployment if there is one) afterwards. This way no new deployments would be created on commit and no cron would run. It will essentially become an empty service with all of your service variables and other settings intact.

Just add the source and cron schedule back once you want to add the service to operate again (CMD/CTRL + K > Deploy latest commit can be used to deploy the latest commit).

5 Replies

Railway
BOT

a year ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


a year ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody • 12 months ago


a year ago

Have you considered making the actual code dependent on an environmental variable?

For example the SHOULD_RUN variable, the code checks it before doing anything. If it's false, exit peacefully. If it's true, continue.


rossfreedman
PROOP

a year ago

I was hoping to not have to modify my code to to make this happen. Is there a configuration I can make to accomplish this?


rossfreedman

I was hoping to not have to modify my code to to make this happen. Is there a configuration I can make to accomplish this?

a year ago

Hey, I would just remove the connected source (for example your GitHub repository) from your service and remove the cron schedule (plus active deployment if there is one) afterwards. This way no new deployments would be created on commit and no cron would run. It will essentially become an empty service with all of your service variables and other settings intact.

Just add the source and cron schedule back once you want to add the service to operate again (CMD/CTRL + K > Deploy latest commit can be used to deploy the latest commit).


rossfreedman
PROOP

a year ago

Got it. Good idea! That worked.


Status changed to Solved uxuz • 12 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...