升级到Laravel 5.4后,排队的Laravel排队作业运行两次

编程入门 行业动态 更新时间:2024-10-28 18:28:45
本文介绍了升级到Laravel 5.4后,排队的Laravel排队作业运行两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们曾经运行过Laravel 5.2,并且对于我们的一项处理任务,我们将运行控制台命令以将作业排队到Redis队列中.在Laravel 5.4升级之前,此作业将排队,并由队列守护程序拾取,并且只能运行一次.但是,升级后,该作业将被拾取两次,相隔大约1分钟. devop的变化为零,因此我试图弄清楚Laravel所做的不同.我还可以验证console命令仅将作业排队一次,因此守护程序的运行方式有所更改.有没有其他人看到过这样的行为?

We used to run Laravel 5.2, and for one of our processing tasks, we'd run a console command to queue up a job into a Redis queue. Prior to the Laravel 5.4 upgrade, this job would queue up and would get picked up by a queue daemon and would only run once. After the upgrade, however, the job gets picked up twice, about 1 minute apart. There have been zero devops changes so I am trying to figure out what Laravel is doing differently. I can also verify that the console command only queues up the job once, so there is something that has changed with how the daemons are running. Has anyone else seen behavior like this?

推荐答案

今天就读一下.不知道是否有帮助.

Just read this today. Don't know if it will help help.

从文档中

-timeout值应至少比您的短几秒钟 retry_after配置值.这将确保工人处理 给定的工作总是在重试该工作之前被杀死.如果您的--timeout选项是 超过您的retry_after配置值,可能会处理您的作业 两次.

"The --timeout value should always be at least several seconds shorter than your retry_after configuration value. This will ensure that a worker processing a given job is always killed before the job is retried. If your --timeout option is longer than your retry_after configuration value, your jobs may be processed twice."

laravel/docs/5.6/queues#队列工人和部署

更多推荐

升级到Laravel 5.4后,排队的Laravel排队作业运行两次

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

发布评论

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

>www.elefans.com

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