Laravel Lumen Queue失败,原因是queue:work,但没有queue:listen [英] Laravel Lumen Queue Failure with queue:work but not queue:listen

查看:302
本文介绍了Laravel Lumen Queue失败,原因是queue:work,但没有queue:listen的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到一个问题,其中有一个将作业插入数据库队列的命令.我有一个服务主管",它基本上在持续执行工匠队列:工作(我还要提一下,我有一个每分钟一次的cron作业,正在运行工匠计划:运行).如果我只运行此命令并让主管在排队的作业应运行时接机,则会出现此异常:

I have an issue where I have a command that inserts jobs into a DB queue. I have a service "supervisor" basically running artisan queue:work continuesily (I should also mention I have a once per min cron job running artisan schedule:run). If I just run this command and let the supervisor pick up when the queued job should run I get this exception:

Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method App\Services\MiddlewareApi::get_lowest_active_customer_number_by_email() in /var/www/vhosts/my-domain.com/httpdocs/my-app/app/Jobs/UpdateBadCustomerNumbersJob.php:48

(我已经检查过了,该类确实具有该方法)

(I have checked and that class does indeed have that method)

但是当我运行php artisan queue:时,请在运行调用UpdateBadCustomerNumberJob.php的命令后立即收听,看来一切正常.我应该对上司进行某种调整吗?如果可以,为什么?

but when I run php artisan queue:listen right after I run the command that calls the UpdateBadCustomerNumberJob.php things seem to function correctly. Should I make some sort of adjustment to my supervisor? If so why?

推荐答案

因此,之所以会出现此问题,是因为队列未处理我已部署的新代码更改.通过运行queue:restart并重新引导Supervisor可以解决此问题.

So it turns out that this issue was called because the queue wasn't picking up the new code changes I had deployed. This issue was solved by running queue:restart and rebooting the Supervisor.

这篇关于Laravel Lumen Queue失败,原因是queue:work,但没有queue:listen的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆