I've provisioned a Laravel Forge server and configured it to use redis
for queues via .env:
QUEUE_DRIVER=redis
My settings for Redis in both config/queue.php
and config/database.php
are the defaults found in a new laravel project.
The problem is that when a mail notification is triggered, it is never added to the queue. It never gets to the processing stage.
I've tried using forge's queue interface as well as SSH into the server and running a simple
php artisan queue:listen
without any parameters. In both cases, no results (using the artisan command confirms no job is added to the queue).
Interestingly, I tried Beanstalkd
:
QUEUE_DRIVER=beanstalkd
and suffered the same problem.
As a sanity check, I set the queue driver to sync:
QUEUE_DRIVER=sync
and the notification was delivered without issue, so there isn't a problem with my code in the notification class, it's somewhere between calling the notify method and being added to the queue.
The same configuration running locally works fine. I can use
php artisan queue:listen
and the notifications go through.
答案 0 :(得分:1)
在努力解决这个问题之后,我发现这是因为应用程序处于维护模式。公平地说,文档确实说明排队的作业不会在维护模式下被触发,但除非你知道维护模式是罪魁祸首,否则你可能不会在该部分中查看。