This commit is contained in:
as2252258@163.com
2021-04-09 02:11:48 +08:00
parent 6c20b1b173
commit 54bc7b0b55
5 changed files with 9 additions and 8 deletions
+3 -3
View File
@@ -46,16 +46,16 @@ 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 {
$start = microtime(true);
$annotation->instanceDirectoryFiles($workerDir = realpath(APP_PATH . 'app/Http'));
$annotation->runtime($workerDir = directory('app/Http'));
$this->error('use time ' . (microtime(true) - $start));
Coroutine\go(function () use ($annotation, $workerDir) {
$annotation->instanceDirectoryFiles(APP_PATH, $workerDir);
$annotation->runtime(directory('app'), $workerDir);
});
$this->onWorker($server, $worker_id);