10 months 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
14 Replies
10 months ago
23b6f92c-43e1-4e11-aad1-7d8f6ae0f126
10 months 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
10 months 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
10 months 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
10 months 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!
10 months ago
fun fact, you can duplicate the service via the service's right click context menu
10 months ago
Didn't know that either i went the long way 🫡
10 months ago
the context menu has some good stuff!
10 months 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?
10 months ago
daily felt fine but minute feels dirty
10 months ago
or i could turn off serverless and use node-cron
10 months 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.
10 months ago
thank you\
10 months ago
!s
Status changed to Solved brody • 10 months ago