From 392d21de55e27d06cb64902061863e369e0a4801 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 9 Apr 2021 03:02:04 +0800 Subject: [PATCH] modify --- HttpServer/Events/OnWorkerStart.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index 781ccd60..07b9cddf 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -54,13 +54,13 @@ class OnWorkerStart extends Callback public function onHandler(Server $server, int $worker_id): void { $annotation = $this->injectLoader(); - (new Pipeline()) - ->if($this->isWorker($worker_id), function ($annotation, $server, $worker_id) { - $annotation->runtime(CONTROLLER_PATH); - $annotation->runtime(APP_PATH, CONTROLLER_PATH); - $this->onWorker($server, $server->worker_id); - name($server->worker_pid, 'Worker.' . $worker_id); - }) + $line = new Pipeline(); + $line->if($this->isWorker($worker_id), function ($annotation, $server, $worker_id) { + $annotation->runtime(CONTROLLER_PATH); + $annotation->runtime(APP_PATH, CONTROLLER_PATH); + $this->onWorker($server, $server->worker_id); + name($server->worker_pid, 'Worker.' . $worker_id); + }) ->else(function ($annotation, $server, $worker_id) { $annotation->runtime(MODEL_PATH); $this->onTask($server, $server->worker_id);