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); }