As mentioned in the laravel docs, you need to use a different tool to keep your queue:work command up and running.
Here are some checklists for preparing your queue:
- Is your
QUEUE_DRIVER environment variable set to the proper driver? (such as redis or sqs)
- Have you installed supervisor and configured the process to run
php artisan queue:work?
- Have you checked how long the queue process time takes?
For No 1, sync is great for local development, but it's not executing in the background so it's not suited for actual production use. You must change it to other queue driver.
For No 2, you can try following this gist for reference.
For No 3, this is to ensure that your job's execution time is well within the allowed execution time of the queue. If I remember correctly, laravel's default queue timeout is 60 seconds, and if the execution goes over 60s, the job will fail prematurely and your email sending will be cutoff. To solve No 3, you will have to optimize the code for shorter execution, or extend the max execution time to be longer.
Hope this helps.
Regards,