我遇到一个问题,其中有一个将作业插入数据库队列的命令.我有一个服务主管",它基本上在持续执行工匠队列:工作(我还要提一下,我有一个每分钟一次的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/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
发布评论