doctrine-queue-worker is a package intended to address common issues with running Laravel 11.x queue worker processes with an application that interacts with the Doctrine ORM.
- Re-queues jobs and kills the worker process when the
EntityManagercloses due to an exception. - Ensures the
EntityManager's database connection remains open between jobs. - Clears the
EntityManagerbetween job executions.
- Require the library via Composer:
composer require pinnacle/doctrine-queue-worker
- Setup worker processes to invoke the
doctine:queue:workartisan command. Options for the command are the same as the built-in Laravelqueue:workcommand. - Use a process manager like supervisor to ensure your queue workers will be restarted after they die.