From e4cf347a663a39fc5b6ca8653debd567154fd00b Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Tue, 4 May 2021 01:11:41 +0800 Subject: [PATCH] modify --- HttpServer/Events/OnWorkerStart.php | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index 7e992c3e..c8834332 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -33,7 +33,10 @@ class OnWorkerStart extends Callback putenv('state=start'); putenv('worker=' . $worker_id); - $annotation = $this->settings(); + $annotation = Snowflake::app()->getAnnotation(); +// $annotation->read(directory('app'),'App'); +// $annotation->runtime(directory('app')); + if ($worker_id < $server->setting['worker_num']) { $this->onWorker($server, $annotation); } else { @@ -42,21 +45,6 @@ class OnWorkerStart extends Callback } - /** - * @return \Annotation\Annotation - * @throws \Exception - */ - private function settings(): Annotation - { - $content = System::readFile(storage('runtime.php')); - - $annotation = Snowflake::app()->getAnnotation(); - $annotation->setLoader(unserialize($content)); - - return $annotation; - } - - /** * @param Server $server * @param int $worker_id