改名
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Server;
|
|||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Http\Route\Router;
|
||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
use Kiri\Exception\NotFindClassException;
|
use Kiri\Exception\NotFindClassException;
|
||||||
@@ -138,19 +139,24 @@ class ServerManager
|
|||||||
{
|
{
|
||||||
$server = $this->server;
|
$server = $this->server;
|
||||||
return new Process(function (Process $soloProcess) use ($customProcess, $server) {
|
return new Process(function (Process $soloProcess) use ($customProcess, $server) {
|
||||||
|
$time = microtime(true);
|
||||||
if (is_string($customProcess)) {
|
if (is_string($customProcess)) {
|
||||||
$customProcess = Kiri::createObject($customProcess, [$server]);
|
$customProcess = Kiri::createObject($customProcess, [$server]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$name = $customProcess->getProcessName($soloProcess);
|
$namespace = array_filter(explode('\\', Router::getNamespace()));
|
||||||
info(sprintf("Process %s start.", $name));
|
|
||||||
|
|
||||||
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);
|
$system = sprintf('%s.process[%d]', Config::get('id', 'system-service'), $soloProcess->pid);
|
||||||
if (Kiri::getPlatform()->isLinux()) {
|
if (Kiri::getPlatform()->isLinux()) {
|
||||||
$soloProcess->name($system . '.' . $name . ' start.');
|
$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->signListen($soloProcess);
|
||||||
$customProcess->onHandler($soloProcess);
|
$customProcess->onHandler($soloProcess);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user