我们曾经运行过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排队作业运行两次
发布评论