This commit is contained in:
as2252258@163.com
2021-02-27 03:59:38 +08:00
parent f4e4364cf2
commit 11a5d6a7df
+5 -3
View File
@@ -56,7 +56,6 @@ class OnWorkerStart extends Callback
} }
/** /**
* @param Server $server * @param Server $server
* @param int $workerId * @param int $workerId
@@ -68,9 +67,12 @@ class OnWorkerStart extends Callback
$sigkill = Coroutine::waitSignal(SIGTERM | SIGKILL | SIGUSR2 | SIGUSR1); $sigkill = Coroutine::waitSignal(SIGTERM | SIGKILL | SIGUSR2 | SIGUSR1);
var_dump($sigkill); var_dump($sigkill);
if ($sigkill !== false) { if ($sigkill !== false) {
while (Snowflake::app()->isRun()) { do {
Coroutine::sleep(0.01); if (!Snowflake::app()->isRun()) {
break;
} }
Coroutine::sleep(0.01);
} while (true);
} }
go(function () use ($server) { go(function () use ($server) {
var_dump(Coroutine::waitPid($server->worker_pid)); var_dump(Coroutine::waitPid($server->worker_pid));