Laravel 5.5:主管不会在队列中运行所有任务

时间:2018-04-03 23:48:18

标签: laravel supervisor

这真的很奇怪。

我的程序将调度一个QuoteCommitSavedListener作业,此作业将触发两个QuoteCommitNotification作业。 (这两个工作都实现了ShouldQueue接口。)

当我在shell中运行此命令时

php /home/nginx/test/artisan queue:work redis --queue=default --tries=3

将显示如下。它真好。

[2018-04-04 07:25:17] Processing: App\Listeners\QuoteCommitSavedListener
[2018-04-04 07:25:18] Processed:  App\Listeners\QuoteCommitSavedListener
[2018-04-04 07:25:18] Processing: App\Notifications\QuoteCommitNotification
[2018-04-04 07:25:22] Processed:  App\Notifications\QuoteCommitNotification
[2018-04-04 07:25:22] Processing: App\Notifications\QuoteCommitNotification
[2018-04-04 07:25:26] Processed:  App\Notifications\QuoteCommitNotification

有一个QuoteCommitSavedListener作业和两个QuoteCommitNotification作业。

但是当我由主管运行队列时,它将显示

[2018-04-04 07:30:43] Processing: App\Listeners\QuoteCommitSavedListener
[2018-04-04 07:30:43] Processed:  App\Listeners\QuoteCommitSavedListener
[2018-04-04 07:30:43] Processing: App\Notifications\QuoteCommitNotification
[2018-04-04 07:30:48] Processed:  App\Notifications\QuoteCommitNotification

我不知道为什么第二个QuoteCommitNotification工作消失了。

这是我的主管配置

[program:test-queue]
command=php /home/nginx/test/artisan queue:work redis --queue=default --tries=3
autostart=true
autorestart=true
numprocs=1
redirect_stderr=true
stdout_logfile=/home/nginx/test/storage/logs/queue-default.log

1 个答案:

答案 0 :(得分:0)

问题是两个laravel应用程序共享一个相同的redis数据库。更改一个配置来解决这个问题。

相关问题