You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running queue:work command, I want to be sure that all the resources are clean and healthy before handling the next job. For example, I would like to rollback or reconnect the DB connection if the previous job was not successful in closing the transaction.
I was thinking to listen to Events\JobProcessing event. However, this event is also fired when pushing a job to a 'sync' queue, and I don't want to reset the DB connection every time I push a job to a 'sync' queue.
The text was updated successfully, but these errors were encountered:
It sounds like you want to run the queue without the daemon mode. Running queue:work --once will only execute one job and then quit; this will close down all resources and database connections (as php scripts do at the end of execution). Running queue:listen will call queue:work --once repeatedly.
I am already aware of that option. However, queue:listen is not efficient enough for my use-case, because of the fork overhead, plus the unnecessary overhead of resetting all the remote connections, when there is no need to.
Running
queue:work
command, I want to be sure that all the resources are clean and healthy before handling the next job. For example, I would like to rollback or reconnect the DB connection if the previous job was not successful in closing the transaction.I was thinking to listen to
Events\JobProcessing
event. However, this event is also fired when pushing a job to a 'sync' queue, and I don't want to reset the DB connection every time I push a job to a 'sync' queue.The text was updated successfully, but these errors were encountered: