Laravel Lumen Queue失败,原因是queue:work,但没有queue:listen

编程入门 行业动态 更新时间:2024-10-24 08:28:08
本文介绍了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/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

本文发布于:2023-07-05 07:02:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034449.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:原因   Queue   Lumen   Laravel   work

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!