halaei
1 year ago
981
1
Laravel

What is the best way to restart horizon?

Posted 1 year ago by halaei

Currently, I issue a artisan horizon:terminate and wait for supervisord to start horizon after the current horizon process gets terminated. This approach has an issue. If there is a job that is supposed to take 1 hour more to gets processed, horizon:terminate will wait for that job one hour without processing other jobs. So it forces a 1 hour delay.

PS: Another option is to call artisan queue:restart. However, this command has some limitation. One is that restarted jobs don't receive changes in the .env file. Another issue is it doesn't let the horizon know of any change in it's own configuration.

Please sign in or create an account to participate in this conversation.