简体   繁体   English

Laravel没有使用数据库执行作业队列

[英]Laravel not performing job queue with database

I am trying to perform a job queue to execute mail and sms functioning in background process. 我正在尝试执行一个作业队列来执行后台进程中的邮件和短信功能。 And it is working with 它正在与之合作

QUEUE_DRIVER=sync

in .env file But when i use it with database .env文件但是当我用它与数据库

QUEUE_DRIVER=database

its not working even after using cli command: 即使使用cli命令后它也无法工作:

php artisan queue:listen

Please tell me what is the problem with such functionality 请告诉我这种功能有什么问题

laravel.log: laravel.log: 在此输入图像描述

here is how i would debug it: 这是我将如何调试它:

  • stop supervisor if you are using it. 如果您正在使用它,请停止主管。
  • cd into your directory and type php artisan queue:listen if you see any errors then likely you have some issues with the job class that you are running laravel 5.2 give you the path in the error and if you look closely you can see in the database the parameters that were passed to the constructor. cd进入你的目录并输入php artisan队列:如果你看到任何错误,那么你可能会遇到一些与你正在运行的作业类有关的问题laravel 5.2给你错误的路径,如果你仔细观察就可以在数据库中看到传递给构造函数的参数。

also check to see if the reserved field in the jobs table is filled, and the attempts are more than 1. 还要检查作业表中的保留字段是否已填充,并且尝试次数大于1。

if the attempts are 0 that means you have a problem with your supervisor service (if you are using it) try unlink /path/to/socket.sock and then run the supervisord command. 如果尝试为0表示您的主管服务有问题(如果您正在使用它),请尝试取消链接/path/to/socket.sock,然后运行supervisord命令。

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

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