改名
This commit is contained in:
+7
-6
@@ -5,7 +5,6 @@ namespace Server;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Kiri\Abstracts\Component;
|
use Kiri\Abstracts\Component;
|
||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
use Kiri\Di\NoteManager;
|
|
||||||
use Kiri\Error\Logger;
|
use Kiri\Error\Logger;
|
||||||
use Kiri\Events\EventDispatch;
|
use Kiri\Events\EventDispatch;
|
||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
@@ -160,15 +159,17 @@ class ServerManager extends Component
|
|||||||
$customProcess = Kiri::getDi()->get($customProcess);
|
$customProcess = Kiri::getDi()->get($customProcess);
|
||||||
}
|
}
|
||||||
$system = sprintf('[%s].process', Config::get('id', 'system-service'));
|
$system = sprintf('[%s].process', Config::get('id', 'system-service'));
|
||||||
$process = new Process(function (Process $process) use ($customProcess, $system) {
|
$this->logger->debug($system . ' ' . $customProcess->getName() . ' start.');
|
||||||
|
$this->server->addProcess(new Process(function (Process $process) use ($customProcess, $system) {
|
||||||
if (Kiri::getPlatform()->isLinux()) {
|
if (Kiri::getPlatform()->isLinux()) {
|
||||||
$process->name($system . '(' . $customProcess->getName() . ')');
|
$process->name($system . '(' . $customProcess->getName() . ')');
|
||||||
}
|
}
|
||||||
$customProcess->onSigterm()->process($process);
|
$customProcess->onSigterm()->process($process);
|
||||||
}, $customProcess->getRedirectStdinAndStdout(), $customProcess->getPipeType(), $customProcess->isEnableCoroutine());
|
},
|
||||||
$this->logger->debug($system . ' ' . $customProcess->getName() . ' start.');
|
$customProcess->getRedirectStdinAndStdout(),
|
||||||
$this->initProcesses[$customProcess->getName()] = $process;
|
$customProcess->getPipeType(),
|
||||||
$this->server->addProcess($process);
|
$customProcess->isEnableCoroutine()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user