From 70a40db7639211151238ed7eddaeec620e00513d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 4 Mar 2021 10:36:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Events/OnWorkerStart.php | 2 ++ System/Application.php | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index b2cd193b..415a7e23 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -36,6 +36,8 @@ class OnWorkerStart extends Callback putenv('worker=' . $worker_id); putenv('state=start'); + annotation()->read(APP_PATH . 'app', 'App'); + if ($worker_id >= $server->setting['worker_num']) { $this->onTask($server, $worker_id); } else { diff --git a/System/Application.php b/System/Application.php index a0a13de0..e3d783ef 100644 --- a/System/Application.php +++ b/System/Application.php @@ -108,9 +108,6 @@ class Application extends BaseApplication public function start(Input $argv): void { try { - $annotation = $this->getAttributes(); - $annotation->read(APP_PATH . 'app', 'App'); - fire(Event::SERVER_BEFORE_START); $this->set('input', $argv);