a month ago
I have some cron services that started to run for hours since today, you can tell the execution ended (logs) but the processing continues....
2 Replies
a month ago
This looks like an application architecture issue, which is beyond the scope of what we directly support, but I can point you in the right direction. Your service is starting as a web server listening on port 9999 and staying running to process incoming requests - the logs show "Server running on port 9999" followed by DBOS initialization, then it waits for requests indefinitely. Cron jobs on Railway need to execute a task and then exit. Since your service is designed to stay alive and handle requests as they come in, it will never terminate on its own, which is why it runs for hours until we force-stop it. If you need this to run as a cron, the code needs to be restructured to perform its task and call process.exit() when complete. If you need it to handle incoming requests on-demand, it should be configured as a regular service (remove the cron schedule) instead of a cron job.
Status changed to Awaiting User Response Railway • 28 days ago
a month ago
I got the exact same behavior yesterday. The same task is called every few hours and usually lasts ~10 ~30 seconds, but yesterday some of the tasks took about 2 hours some others 12 to 15 minutes. I will check the process.exit method if the issue appears again, but in general it just fixed itself
Status changed to Awaiting Railway Response Railway • 27 days ago
Status changed to Solved brody • 27 days ago