This commit is contained in:
xl
2024-08-29 17:01:07 +08:00
parent b14b18040b
commit 917e82064a
8 changed files with 34 additions and 75 deletions
+2 -9
View File
@@ -24,13 +24,6 @@ trait TraitServer
private array $_process = [];
/**
* @var StdoutLogger
*/
#[Container(LoggerInterface::class)]
public StdoutLogger $logger;
/**
* @param string|array|BaseProcess $class
* @return void
@@ -64,7 +57,7 @@ trait TraitServer
private function genProcess(BaseProcess $name): Process
{
return new Process(function (Process $process) use ($name) {
$process->name('[' . \config('id','system-service') . ']' . $name->getName());
$process->name('[' . \config('id','system-service') . '].' . $name->getName());
$name->onSigterm()->process($process);
},
$name->getRedirectStdinAndStdout(),
@@ -111,7 +104,7 @@ trait TraitServer
public function onSigint($no, array $signInfo): void
{
try {
$this->logger->alert('Pid ' . getmypid() . ' get signo ' . $no);
Kiri::getLogger()->alert('Pid ' . getmypid() . ' get signo ' . $no);
$this->shutdown();
} catch (\Throwable $exception) {
error($exception);