This commit is contained in:
2021-04-19 15:20:40 +08:00
parent 83cf62cbba
commit 38425b4d7e
3 changed files with 4 additions and 5 deletions
+1 -3
View File
@@ -86,9 +86,7 @@ class Annotation extends Component
*/
public function runtime(string $dir, string|array $outPath = null)
{
if ($outPath === null) {
$outPath = [];
} else if (!empty($outPath) && !is_array($outPath)) {
if (!empty($outPath) && !is_array($outPath)) {
$outPath = [$outPath];
}
$this->_loader->loadByDirectory($dir, $outPath);
+1 -1
View File
@@ -238,7 +238,7 @@ class Loader extends BaseObject
if (!str_contains($key, $path)) {
continue;
}
if (in_array($key, $outPath)) continue;
if (!empty($outPath) && in_array($key, $outPath)) continue;
$this->execute($_path);
}
} catch (Throwable $exception) {
+2 -1
View File
@@ -90,8 +90,9 @@ class OnWorkerStart extends Callback
name($server->worker_pid, 'Worker#' . $server->worker_id);
$time = microtime(true);
$annotation->runtime(directory('app'));
$annotation->runtime(CONTROLLER_PATH);
$this->debug('use time.' . microtime(true) - $time);
$annotation->runtime(directory('app'), CONTROLLER_PATH);
Snowflake::setWorkerId($server->worker_pid);
putenv('environmental=' . Snowflake::WORKER);