繁体   English   中英

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

[英]Laravel 5.5: Supervisor Does Not Run All Tasks In Queue

这真的很奇怪。

我的程序将分派一个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

问题是两个laravel应用程序共享同一个Redis数据库。 更改配置以解决此问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM