I have a list of jobs in my database, when I run php artisan queue:work database
, it processes each job but once it processes the last one, it doesn't seem to stop. I thought doing it this way would mean once the worker has no jobs left, it stops.
关注
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率

已采纳
Laravel Worker似乎没有停止
收起
- 写回答
- 好问题 0 提建议
- 关注问题
微信扫一扫
点击复制链接分享
- 邀请回答
- 编辑 收藏 删除 结题
- 收藏 举报
2条回答 默认 最新
- 关注
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率
doushenken2833 2018-10-19 12:48关注Add the
--once
option if you want the worker to exit after running one job:$ php artisan queue:work --once
As of 5.7 you can use
--stop-when-empty
to process all jobs in the queue and then exit:$ php artisan queue:work --stop-when-empty
Docs: https://laravel.com/docs/5.7/queues#running-the-queue-worker
Note: The default behavior changed around Laravel 5.3. Previously a worker would process one job and exit; it only continued running if the
--daemon
option had been used. After 5.3 this became the default behavior, and--daemon
was deprecated.本回答被题主选为最佳回答 , 对您是否有帮助呢? 本回答被专家选为最佳回答 , 对您是否有帮助呢? 本回答被题主和专家选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏举报微信扫一扫
点击复制链接分享
编辑预览轻敲空格完成输入- 显示为
- 卡片
- 标题
- 链接
评论按下Enter换行,Ctrl+Enter发表内容
编辑
预览

轻敲空格完成输入
- 显示为
- 卡片
- 标题
- 链接
报告相同问题?
提交
- 2019-06-05 06:52回答 1 已采纳 From what I know nothing guarantees that after a job has been processed the next job would start i
- 2016-12-16 07:46回答 1 已采纳 Try to rebuild your environment.
- 2019-05-22 06:15回答 2 已采纳 In the end I found that the queue worker was really exceeding the timeout. It was due to the fact
- 2019-08-27 10:18"elegant-laravel-worker"是针对Laravel队列工作的一个项目,它专注于在接收到`SIGTERM`信号时优雅地停止工作进程,确保正在处理的任务得以完成,而不会丢失任何数据或状态。 Laravel队列工作器(Worker)是用于...
- 2019-04-26 07:41回答 1 已采纳 I found a way to obtain the desired behavior, but I am not sure this is the best way, so I post it
- 2016-05-10 05:19回答 1 已采纳 This purely depends on the following How much clients or users you have. How much of them wil
- 2016-09-09 08:57回答 2 已采纳 This would be a lot to put in the view but here's the basic concept of what I think you are lookin
- 2021-12-24 08:59凡尘-追梦者的博客 GatewayWorker 与 Workerman的关系 Workerman可以看做是一个纯粹的socket类库,可以开发几乎所有的网络应用,不管是TCP的还是UDP的,长连接的还是短连接的。Workerman代码精简,功能强大,使用灵活,能够快速开发出...
- 2018-04-07 07:50回答 3 已采纳 There is a --sleep option for queue workers: php artisan queue:work --help The default is 3 sec
- 2015-08-25 18:02回答 2 已采纳 The Symfony Process Component by default will execute the supplied command within the current work
- 2016-04-25 17:09回答 3 已采纳 检查下电脑是否感染了360等非法流氓软件。
- 2021-04-12 03:00勤劳的伐木使的博客 为了处理大量的工作,我运行可变数量的队列工作者,具体取决于完成的工作量....我知道在部署时,我必须首先通过使用php artisan down将框架置于维护模式来停止队列工作,因为–daemon标志导致框架仅...
- 2021-11-29 07:40特别剑的博客 laravel+GatewayWorker 完成IM即时通信以及文件互传功能(第四章:服务端调试错误)功能简介应用场景专题章节第四章:服务端调试错误一、在服务器终端运行GatewayWorker的PHP启动命令进行报错调试 功能简介 本专题将...
- 2021-04-26 06:13zha567的博客 24:09作者:wangjian浏览量:979点赞量:0laravel框架中队列的目的是将耗时的任务延时处理,比如发送邮件,从而大幅度缩短 Web 请求和相应的时间一:队列配置队列的配置文件放置在config/queue.php文件中laravel框架...
- 2021-04-26 06:13巴老板的博客 这篇文章主要介绍的内容是关于Laravel 的队列系统介绍,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下Laravel 队列为不同的后台队列服务提供统一的 API , 例如 Beanstalk,Amazon SQS, Redis,...
- 没有解决我的问题, 去提问
联系我们(工作时间:8:30-22:00)
400-660-0108kefu@csdn.net在线客服
- 京ICP备19004658号
- 经营性网站备案信息
公安备案号11010502030143
- 营业执照
- 北京互联网违法和不良信息举报中心
- 家长监护
- 中国互联网举报中心
- 网络110报警服务
- Chrome商店下载
- 账号管理规范
- 版权与免责声明
- 版权申诉
- 出版物许可证
- ©1999-2025北京创新乐知网络技术有限公司