From cabdd0ba831be9a19cf2d0e8b152329d46599ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 28 Dec 2020 18:26:06 +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 --- HttpServer/Server.php | 4 ++++ System/Process/Process.php | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/HttpServer/Server.php b/HttpServer/Server.php index 41419f48..54bc8578 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -251,6 +251,10 @@ class Server extends Application $system->write(Json::encode($this->params[$name])); } $this->baseServer->addProcess($system); + if (Snowflake::isLinux()) { + $prefix = ucfirst(rtrim(Snowflake::app()->id, ':')); + $system->name($prefix . ': ' . $name . '::' . $process); + } $application->set($process, $system); } } diff --git a/System/Process/Process.php b/System/Process/Process.php index 2b724210..addbbf44 100644 --- a/System/Process/Process.php +++ b/System/Process/Process.php @@ -29,12 +29,7 @@ abstract class Process extends \Swoole\Process */ public function __construct($application, $name, $enable_coroutine = true) { - $class = get_called_class(); - parent::__construct(function ($process) use ($name, $class) { - if (Snowflake::isLinux()) { - $prefix = ucfirst(rtrim(Snowflake::app()->id, ':')); - $this->name($prefix . ': ' . $class . '::class'); - } + parent::__construct(function ($process) use ($name) { $this->onHandler($process); }, false, 1, $enable_coroutine); $this->application = $application;