Using Cron instead of scheduling in code
Im using
node-schedule
to do the following in my code;
but just noticed the Cron Schedule on railway settings, could I do away with the scheduler-in-code stuff with this, and just my code self executes runStuff()
- or am i misunderstanding the cron stuff on railways side of thingsSolution:Jump to solution
yeah I think you got the understanding down, remove the node-cron stuff from your code and have your code start the
runStuff()
function when it starts, and then exit when done, and railways scheduler will run the set start command on your set schedule5 Replies
Project ID:
93709d46-9f33-4a5b-8651-5e9565510c7c
93709d46-9f33-4a5b-8651-5e9565510c7c
I think im asking if the cron schedule will just re-run my index file, or if it like invokes a whole new build or something
Solution
yeah I think you got the understanding down, remove the node-cron stuff from your code and have your code start the
runStuff()
function when it starts, and then exit when done, and railways scheduler will run the set start command on your set schedulegreat - that makes sense. ill give it a try now i know im on right path, thanks!
no prob!