supervisor 守护进程热更新的时候大家怎么处理的
修改队列里边的代码
如果用 supervisorctl restart all
这样就相当于重启队列
如果此时有执行的任务,就直接放弃了。。
大家遇到这种情况怎么处理
修改队列里边的代码
如果用 supervisorctl restart all
这样就相当于重启队列
如果此时有执行的任务,就直接放弃了。。
大家遇到这种情况怎么处理
在 laravel 队列执行过程中 supervisorctl restart test
然后出现了两个 testJob.time() 的文件,这也就说明任务出现重复执行的情况。
retry_after=86400
“`
$i = 10000000;
while ($i) {
if ($i == 10000000) {
LogInfo(‘testJob’ . time(), $i);
} else {
LogInfo(‘testJob’, $i);
}
$i–;
}
“`
https://www.php.net/manual/en/function.pcntl-signal.php
示例还是很清晰的,关键在于理解 declare(ticks = 1);
然后守护进程直接用 supervisor
你给我的方案在于手动去实现一个守护进程,这样的话,我用 supervisor 就没意义了。
难道我想歪了吗
重启不依托于 supervisorctl
下边这条指令可以
php artisan queue:restart
You should ensure that the value of stopwaitsecs is greater than the number of seconds consumed by your longest running job. Otherwise, Supervisor may kill the job before it is finished processing.
意思你配置 supervisor 的 stopwaitsecs 参数必须足够大,保证 worker 能完成正在处理的任务
谢谢各位了