This commit is contained in:
xl
2024-09-04 11:21:12 +08:00
parent 90154ece54
commit 9b22f66571
2 changed files with 4 additions and 12 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ class OnServerWorker extends Kiri\Server\Abstracts\Server
*/
protected function processName(Server $server, string $prefix): void
{
Kiri::setProcessName(sprintf($prefix . ' AbstractProcess[%d].%d', $server->worker_pid, $server->worker_id));
Kiri::setProcessName(sprintf($prefix . ' Process[%d].%d', $server->worker_pid, $server->worker_id));
}
+3 -11
View File
@@ -22,21 +22,13 @@ trait TraitProcess
*/
public function addProcess(string|array|AbstractProcess $class): void
{
if (!is_array($class)) {
$class = [$class];
}
if (!is_array($class)) $class = [$class];
foreach ($class as $name) {
if (is_string($name)) {
$name = Kiri::getDi()->get($name);
}
if (is_string($name)) $name = Kiri::getDi()->get($name);
if (isset($this->_process[$name->getName()])) {
throw new Exception('AbstractProcess(' . $name->getName() . ') is exists.');
}
$process = $this->genProcess($name);
if ($name->isEnableQueue()) {
$process->useQueue();
}
$this->_process[$name->getName()] = $process;
$this->_process[$name->getName()] = $this->genProcess($name);
}
}