Symfony Worker Service doesn't remain up
Anonymous
PROOP

a month ago

I have been following your guide for Symfony here: https://docs.railway.com/guides/symfonyhe webserver works fine, however I need a worker service, I followed instructions, created a script:


php bin/console messenger:consume async webhook --time-limit=3600 --memory-limit=256M -vv

Please note I had to remove the & from the end of the script otherwise it never worked. nothing actually ran

I then see the worker service start up, it runs for a hour and then just goes to completed. It looks like the time limit is hit but never respawns a new messenger. I have to restart the service for it to start working again, obviously this is unsubstanable

Solved

1 Replies

Railway
BOT

a month ago

Your worker exits cleanly (exit code 0) when the --time-limit is reached, and the default restart policy "On Failure" only restarts services that exit with a non-zero code. Change the restart policy to "Always" in your service's Settings tab so that it automatically restarts after the time limit expires. This setting is available on your Pro plan. See Restart Policy docs for details.


Status changed to Awaiting User Response Railway about 1 month ago


Status changed to Solved Anonymous 29 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...