From 3b186e94a251a6cd6cd5cec2733c30d3365bd4d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 29 Mar 2021 11:45:08 +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/Events/OnWorkerStart.php | 2 +- function.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index 0c84ed6f..11f1eb39 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -35,7 +35,7 @@ class OnWorkerStart extends Callback putenv('state=start'); putenv('worker=' . $worker_id); - name($server->worker_pid, Snowflake::isTask() ? 'task' : 'worker'); + name($server->worker_pid, $worker_id >= $server->setting['worker_num'] ? 'task' : 'worker'); if ($worker_id >= $server->setting['worker_num']) { $this->onTask($server, $worker_id); diff --git a/function.php b/function.php index 0f48a6ab..0ff96053 100644 --- a/function.php +++ b/function.php @@ -583,6 +583,7 @@ if (!function_exists('name')) { /** * @param int $pid + * @param string|null $prefix * @throws ConfigException * @throws Exception */ @@ -594,7 +595,7 @@ if (!function_exists('name')) { $name = Config::get('id', false, 'system') . '[' . $pid . ']'; if (!empty($prefix)) { - $name .= $prefix; + $name .= '.' . $prefix; } swoole_set_process_name($name); }