This commit is contained in:
as2252258@163.com
2021-04-08 00:38:29 +08:00
parent c5dd60258d
commit 482581b97b
3 changed files with 330 additions and 235 deletions
+8 -2
View File
@@ -46,11 +46,17 @@ class OnWorkerStart extends Callback
$annotation->setLoader($runtime);
if ($worker_id >= $server->setting['worker_num']) {
$annotation->instanceDirectoryFiles(MODEL_PATH);
$annotation->runtime(MODEL_PATH);
$this->onTask($server, $worker_id);
} else {
$annotation->instanceDirectoryFiles(APP_PATH);
$start = microtime(true);
$annotation->runtime(CONTROLLER_PATH);
$annotation->runtime(APP_PATH, CONTROLLER_PATH);
$this->error('use time ' . (microtime(true) - $start));
$this->onWorker($server, $worker_id);
}