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;