From 37b59c853651484200fa4f10810c958bbb446bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 16 Jul 2025 14:54:35 +0800 Subject: [PATCH] eee --- Handler/OnServerWorker.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Handler/OnServerWorker.php b/Handler/OnServerWorker.php index 191221f..5104544 100644 --- a/Handler/OnServerWorker.php +++ b/Handler/OnServerWorker.php @@ -71,15 +71,19 @@ class OnServerWorker extends Kiri\Server\Abstracts\Server */ public function onWorkerStart(Server $server, int $workerId): void { - $this->dispatch->dispatch(new OnBeforeWorkerStart($server, $workerId)); - if ($workerId < $server->setting['worker_num']) { - CoordinatorManager::utility(Coordinator::WORKER_START)->waite(); + try { + $this->dispatch->dispatch(new OnBeforeWorkerStart($server, $workerId)); + if ($workerId < $server->setting['worker_num']) { + CoordinatorManager::utility(Coordinator::WORKER_START)->waite(); - $this->dispatch->dispatch(new OnWorkerStart($server, $workerId)); - } else { - $this->dispatch->dispatch(new OnTaskerStart($server, $workerId)); + $this->dispatch->dispatch(new OnWorkerStart($server, $workerId)); + } else { + $this->dispatch->dispatch(new OnTaskerStart($server, $workerId)); + } + $this->dispatch->dispatch(new OnAfterWorkerStart($server, $workerId)); + } catch (Throwable $exception) { + Kiri::getLogger()->println(throwable($exception)); } - $this->dispatch->dispatch(new OnAfterWorkerStart($server, $workerId)); }