modify plugin name
This commit is contained in:
@@ -14,7 +14,8 @@ use Kiri\Application;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Di\Container;
|
||||
use Kiri\Environmental;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Kiri\Di\ContainerInterface;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Swoole\Coroutine;
|
||||
use Swoole\Process;
|
||||
use Swoole\WebSocket\Server;
|
||||
@@ -149,7 +150,6 @@ class Kiri
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param $className
|
||||
* @param array $construct
|
||||
@@ -172,6 +172,24 @@ class Kiri
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $prefix
|
||||
* @return void
|
||||
* @throws ConfigException
|
||||
*/
|
||||
public static function setProcessName($prefix): void
|
||||
{
|
||||
if (Kiri::getPlatform()->isMac()) {
|
||||
return;
|
||||
}
|
||||
$name = '[' . Config::get('id', 'system-service') . ']';
|
||||
if (!empty($prefix)) {
|
||||
$name .= '.' . $prefix;
|
||||
}
|
||||
swoole_set_process_name($name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws Exception
|
||||
@@ -311,7 +329,6 @@ class Kiri
|
||||
}
|
||||
|
||||
|
||||
|
||||
const PROCESS = 'process';
|
||||
const TASK = 'task';
|
||||
const WORKER = 'worker';
|
||||
|
||||
Reference in New Issue
Block a user