From 5c7ae1a9c99b61bcd700bb3050d37f94e962cbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 4 Mar 2021 11:01:29 +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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index 0f108baf..2e846e16 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -40,6 +40,10 @@ class OnWorkerStart extends Callback annotation()->read(APP_PATH . 'app', 'App'); $this->debug(sprintf('scan app dir use time %s', microtime(true) - $start)); + $config = sweep(APP_PATH . '/config'); + foreach ($config as $key => $value) { + Config::set($key, $value); + } if ($worker_id >= $server->setting['worker_num']) { $this->onTask($server, $worker_id); @@ -62,7 +66,6 @@ class OnWorkerStart extends Callback $prefix = sprintf('%s #%d Pid:%d start.', ucfirst(env('environmental')), $worker_id, $server->worker_pid); - $start = microtime(true); fire(Event::SERVER_TASK_START); $this->debug(sprintf('%s use time %s', $prefix, microtime(true) - $start));