Skip to content
duplicate project just for a cronned script

2 years ago

is duplicating a project (already on railway) purely to use scheduled deployment, to pretend-cron a script thats in the codebase, a terrible idea? in my head its the entire project sat there again for 1 script, seems wasteful

am just trying to get the fastest easiest way of having an action run on the codebase, but im currently serverless on railway, so kinda rules out node-cron

Solved

14 Replies

2 years ago

23b6f92c-43e1-4e11-aad1-7d8f6ae0f126


2 years ago

duplicate the service within the same project so its not as messy? and then as long as theres no need for a volume it should work relatively fine


2 years ago

the more complicated way to do it that would work even with a volume would be to add code to trigger the script when a certain endpoint is hit and then use other services (or even railway with a simple curl service?) that allow hitting an endpoint on a cron schedule


2 years ago

I actually think that's what I mean, duplicate service within the project.

It'd not need a volume, not need external web access, I have since noticed I can take the cores and stuff right down too


2 years ago

I did consider some sort of external Cron too but it felt more effort. I think I'll go with the duplicate service for now and just keep an eye on usage!


2 years ago

fun fact, you can duplicate the service via the service's right click context menu


2 years ago

Didn't know that either i went the long way 🫡


2 years ago

the context menu has some good stuff!


2 years ago

just on this, if i want something that needs to run on like a minute schedule - say for checking for scheduled posts, and kicking them off, im guessing cron builds with the start command as a script at that interval might be silly, and i should look to some other external cron service, w/ a webhook or smth?


2 years ago

daily felt fine but minute feels dirty


2 years ago

or i could turn off serverless and use node-cron


2 years ago

hello,

slight misunderstanding, we do not rebuild or redeploy on whatever the set schedule may be, we are simply starting the already built image again.

but even so, the minimum frequency you can run crons on is 5 minutes, so if you need anything with a higher frequency then you would need to move to an in-code scheduler like node-cron or equivalent.


2 years ago

thank you\


2 years ago

!s


Status changed to Solved brody • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...