This commit is contained in:
2021-03-04 11:01:29 +08:00
parent 2bf341d23d
commit 5c7ae1a9c9
+4 -1
View File
@@ -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));