R
Railway10mo ago
Umang

Cron not working

Project id - 8255344d-43ae-4e2a-ade0-557ac96ab17e Cron set for 12:00 UTC/05:30 IST (my local time) is not running automatically and I'm required to run it manually for the past 3 days
No description
14 Replies
Percy
Percy10mo ago
Project ID: 8255344d-43ae-4e2a-ade0-557ac96ab17e
Brody
Brody10mo ago
what kind of app is this?
Umang
Umang10mo ago
might been getting your question wrong, but node express server, using the redis, postgres and cron plugin expriencing the issue post plugins migration
Brody
Brody10mo ago
(that's the perfect answer to my question) but now I'm not sure why you are trying to use railways cron scheduler for an express server?
Umang
Umang10mo ago
not sure of the exact reason my team went ahead with it, but most probably was easier to set up we had a custom cron service running earlier for one function, but adding more functions was causing issues so we bundled them together and used the railway cron fwiw there's no updates in cron service and it was working well before plugin migration
No description
Brody
Brody10mo ago
railways cron will not run the next schedule if your app hasn't existed by the time it's time to run the next schedule so I'll just say outright, you have the wrong idea, you should not be using railway cron scheduler on a web server if you have tasks within that service that need to run, you will want to use node-cron in code, or split the tasks off into a worker service that does the set tasks and exits when done
Anish
Anish10mo ago
yo, im working with @Vampo on this project, so it is not an express web server, rather 3 scripts which are run one after the other
"dev:cron": "tsx src/cron.ts && tsx src/lcron.ts && tsx src/scron.ts",
"dev:cron": "tsx src/cron.ts && tsx src/lcron.ts && tsx src/scron.ts",
all 3 scripts run and call process.exit(0) (they should hardly take a few seconds) this was working fine for the past month or so but we started facing the problem a few days back
Brody
Brody10mo ago
okay thanks for clearing that up! and the logs do indicate that all three scripts complete and exit? does the status of the last deployment say completed?
Umang
Umang10mo ago
guys the cron last ran on 19th and didnn't for the last 2 days
No description
Umang
Umang10mo ago
yes on 19th last it worked correctly
Brody
Brody10mo ago
you're absolutely positive your code finishes and exists cleanly after it's done?
Umang
Umang10mo ago
yes 100%, all three scripts runs and exit as expected without any errors
Brody
Brody10mo ago
okay I'll ping the applicable person when I see they're online! @Greg - cron jobs not running despite the prevoius job completing
Greg Schier
Greg Schier10mo ago
It does indeed look to be on our end (timing out waiting to start). I've added it to triage to take a look next week. I suspect that midnight is a popular cron time so it might help to change it to a different time like 1 or 2 AM, for now
Want results from more Discord servers?
Add your server