改名
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Server;
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use Http\Route\Router;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
@@ -138,19 +139,24 @@ class ServerManager
|
||||
{
|
||||
$server = $this->server;
|
||||
return new Process(function (Process $soloProcess) use ($customProcess, $server) {
|
||||
$time = microtime(true);
|
||||
if (is_string($customProcess)) {
|
||||
$customProcess = Kiri::createObject($customProcess, [$server]);
|
||||
}
|
||||
|
||||
$name = $customProcess->getProcessName($soloProcess);
|
||||
info(sprintf("Process %s start.", $name));
|
||||
$namespace = array_filter(explode('\\', Router::getNamespace()));
|
||||
|
||||
scan_directory(directory('app'), 'App');
|
||||
$namespace = APP_PATH . implode('/', $namespace);
|
||||
|
||||
$name = $customProcess->getProcessName($soloProcess);
|
||||
scan_directory(directory('app'), 'App', [$namespace]);
|
||||
|
||||
$system = sprintf('%s.process[%d]', Config::get('id', 'system-service'), $soloProcess->pid);
|
||||
if (Kiri::getPlatform()->isLinux()) {
|
||||
$soloProcess->name($system . '.' . $name . ' start.');
|
||||
}
|
||||
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Builder %s[%d].%d use time %s.", 'Process',
|
||||
$server->master_pid, $soloProcess->pid, round(microtime(true) - $time, 6) . 's') . PHP_EOL;
|
||||
$customProcess->signListen($soloProcess);
|
||||
$customProcess->onHandler($soloProcess);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user