From d0c579455ded071dfb4ec36acd8f25ac735887e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 6 Jul 2021 16:30:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Process/Process.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/System/Process/Process.php b/System/Process/Process.php index 698588ae..64f08398 100644 --- a/System/Process/Process.php +++ b/System/Process/Process.php @@ -28,7 +28,6 @@ abstract class Process extends \Swoole\Process implements SProcess public function __construct($application, $name, $enable_coroutine = true) { parent::__construct([$this, '_load'], false, 1, $enable_coroutine); - Snowflake::setProcessId($this->pid); } /** @@ -37,6 +36,8 @@ abstract class Process extends \Swoole\Process implements SProcess */ public function _load(Process $process) { + Snowflake::setProcessId($this->pid); + putenv('environmental=' . Snowflake::PROCESS); fire(Event::SERVER_WORKER_START);