This commit is contained in:
2021-03-02 14:17:02 +08:00
parent fb0ed1b990
commit 482ea9be0e
2 changed files with 4 additions and 5 deletions
-5
View File
@@ -27,7 +27,6 @@ class OnWorkerStart extends Callback
/** @var int 重启信号 */ /** @var int 重启信号 */
private int $signal = SIGUSR1 | SIGUSR2 | SIGKILL; private int $signal = SIGUSR1 | SIGUSR2 | SIGKILL;
private int $hook = SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_BLOCKING_FUNCTION | SWOOLE_HOOK_CURL;
/** /**
@@ -42,10 +41,6 @@ class OnWorkerStart extends Callback
{ {
putenv('worker=' . $worker_id); putenv('worker=' . $worker_id);
Runtime::enableCoroutine(true, $this->hook);
Coroutine::set(['enable_deadlock_check' => false]);
if ($worker_id >= $server->setting['worker_num']) { if ($worker_id >= $server->setting['worker_num']) {
$this->onTask($server, $worker_id); $this->onTask($server, $worker_id);
} else { } else {
+4
View File
@@ -144,6 +144,10 @@ class Server extends HttpService
return 'ok'; return 'ok';
} }
Runtime::enableCoroutine(true, SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_BLOCKING_FUNCTION | SWOOLE_HOOK_CURL);
Coroutine::set(['enable_deadlock_check' => false]);
return $baseServer->start(); return $baseServer->start();
} }