Crons display as still running after their containers have died
gigamesh
HOBBYOP

2 years ago

This seems to be a bug?

All three of these containers are dead.

6 Replies

2 years ago

Does your code explicitly exit?


gigamesh
HOBBYOP

2 years ago

Oh - no that makes sense. Thank you. :)


2 years ago

No problem!


gigamesh
HOBBYOP

2 years ago

Hmm - I'm still seeing this despite explicitly existing.

I'm using process.exit() in a node app. I'm assuming that should work?


2 years ago

Exiting wouldn't have fixed the old running executions, since that was purely a display bug, though I have manually marked them as completed.

Additionally, your start command of cd apps/server && npm run convictionsCron is far from ideal for production environments.

Using cd is almost never the correct solution, and running your app via npm is not ideal either because npm does not propagate signals.

As far as I can tell your start command does stuff like prisma generate and injects env vars from dotenvx.

And for an optimised start command you can still do that, but in the end, node should be the single process that runs your javascript file.

That means transpiling with tsx during build and modifying your start command to run node directly, instead of through npm or dotenvx.


gigamesh
HOBBYOP

2 years ago

Ah ok thats really helpful info. thank you


Welcome!

Sign in to your Railway account to join the conversation.

Loading...