This commit is contained in:
as2252258@163.com
2021-02-27 03:08:08 +08:00
parent 4303446767
commit 8a77a80f8a
+4 -1
View File
@@ -60,6 +60,9 @@ class OnWorkerStart extends Callback
*/ */
public function onTaskSignal(Server $server, int $workerId) public function onTaskSignal(Server $server, int $workerId)
{ {
go(function () use ($server) {
var_dump(Coroutine\System::waitPid($server->worker_pid, -1));
});
go(function () use ($server, $workerId) { go(function () use ($server, $workerId) {
try { try {
$sigkill = Coroutine::waitSignal(SIGKILL | SIGUSR1); $sigkill = Coroutine::waitSignal(SIGKILL | SIGUSR1);
@@ -69,7 +72,7 @@ class OnWorkerStart extends Callback
} }
} }
Snowflake::app()->stateInit(); Snowflake::app()->stateInit();
$server->stop($workerId, true); $server->stop($server->worker_id, true);
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
$this->addError($exception); $this->addError($exception);
} }