This commit is contained in:
2020-10-21 15:09:15 +08:00
parent 5934dc8cac
commit 8c1e48dc8b
2 changed files with 6 additions and 7 deletions
+4
View File
@@ -14,6 +14,7 @@ use Snowflake\Error\Logger;
use Snowflake\Event;
use Snowflake\Exception\ConfigException;
use Snowflake\Snowflake;
use Swoole\Coroutine\System;
use Swoole\Server;
/**
@@ -37,6 +38,9 @@ class OnWorkerStart extends Callback
if (!empty($get_name) && !Snowflake::isMac()) {
swoole_set_process_name($get_name);
}
go(function () use ($server) {
System::waitPid($server->master_pid);
});
if ($worker_id >= $server->setting['worker_num']) {
return;
}