This commit is contained in:
2021-03-29 11:36:09 +08:00
parent fe6c754857
commit 118ac9efe5
4 changed files with 16 additions and 9 deletions
+4 -2
View File
@@ -586,14 +586,16 @@ if (!function_exists('name')) {
* @throws ConfigException
* @throws Exception
*/
function name(int $pid)
function name(int $pid, string $prefix = null)
{
if (Snowflake::getPlatform()->isMac()) {
return;
}
$name = Config::get('id', false, 'system') . '[' . $pid . ']';
if (!empty($prefix)) {
$name .= $prefix;
}
swoole_set_process_name($name);
}