This commit is contained in:
2021-08-05 15:55:27 +08:00
parent a9e172b975
commit 6b9ef31df8
10 changed files with 95 additions and 70 deletions
+7 -3
View File
@@ -53,19 +53,23 @@ class ServerWorker extends \Server\Abstracts\Server
$this->runEvent(Constant::WORKER_START, null, [$server, $workerId]);
$this->workerInitExecutor($server, $annotation, $workerId);
$this->interpretDirectory($annotation);
$this->interpretDirectory($server, $annotation, $workerId);
}
/**
* @param Server $server
* @param Annotation $annotation
* @param $workerId
* @throws NotFindClassException
* @throws ReflectionException
* @throws Exception
*/
private function interpretDirectory(Annotation $annotation)
private function interpretDirectory(Server $server, Annotation $annotation, $workerId)
{
$fileLists = $annotation->runtime(APP_PATH . 'app');
$fileLists = $annotation->runtime(APP_PATH . 'app',
$workerId < $server->setting['worker_num'] ? [CONTROLLER_PATH] : []
);
$di = Snowflake::getDi();
foreach ($fileLists as $class) {