改名
This commit is contained in:
@@ -48,25 +48,26 @@ class ServerWorker extends \Server\Abstracts\Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->workerInitExecutor($server, $annotation, $workerId);
|
$this->workerInitExecutor($server, $annotation, $workerId);
|
||||||
$this->interpretDirectory($annotation);
|
$this->interpretDirectory($server, $annotation);
|
||||||
|
|
||||||
$store->close();
|
$store->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param Server $server
|
||||||
* @param Annotation $annotation
|
* @param Annotation $annotation
|
||||||
* @throws ReflectionException
|
|
||||||
* @throws NotFindClassException
|
* @throws NotFindClassException
|
||||||
|
* @throws ReflectionException
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function interpretDirectory(Annotation $annotation)
|
private function interpretDirectory(Server $server, Annotation $annotation)
|
||||||
{
|
{
|
||||||
$fileLists = $annotation->runtime(APP_PATH . 'app');
|
$fileLists = $annotation->runtime(APP_PATH . 'app');
|
||||||
|
|
||||||
$di = Snowflake::getDi();
|
$di = Snowflake::getDi();
|
||||||
foreach ($fileLists as $file => $class) {
|
foreach ($fileLists as $file => $class) {
|
||||||
if (!Snowflake::isWorker() && str_contains($file, CONTROLLER_PATH)) {
|
if ($server->worker_id >= $server->setting['worker_num'] && str_contains($file, CONTROLLER_PATH)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$instance = $di->get($class);
|
$instance = $di->get($class);
|
||||||
|
|||||||
Reference in New Issue
Block a user