Skip to content

Commit d8008ca

Browse files
committed
强制结束队列进程时关闭死锁检测
1 parent 3f643a5 commit d8008ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/concerns/InteractsWithQueue.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace think\swoole\concerns;
44

5+
use Swoole\Coroutine;
56
use Swoole\Process;
67
use Swoole\Timer;
78
use think\helper\Arr;
@@ -35,6 +36,10 @@ protected function createQueueWorkers()
3536

3637
while (true) {
3738
$timer = Timer::after($timeout * 1000, function () use ($pool) {
39+
//关闭协程死锁检查
40+
Coroutine::set([
41+
'enable_deadlock_check' => false,
42+
]);
3843
$pool->getProcess()->exit();
3944
});
4045

0 commit comments

Comments
 (0)