This commit is contained in:
2021-11-01 17:12:47 +08:00
parent 6ee19ec336
commit b65abedede
3 changed files with 17 additions and 13 deletions
+3 -3
View File
@@ -25,9 +25,9 @@ class OnTaskerStart extends WorkerStart implements EventDispatcherInterface
$time = microtime(true);
ServerManager::setEnv('environmental', Kiri::TASK);
if (!is_enable_file_modification_listening()) {
$this->interpretDirectory();
}
// if (!is_enable_file_modification_listening()) {
// $this->interpretDirectory();
// }
$this->mixed($event, false, $time);
}
+4 -4
View File
@@ -30,10 +30,10 @@ class OnWorkerStart extends WorkerStart implements EventDispatcherInterface
$time = microtime(true);
ServerManager::setEnv('environmental', Kiri::WORKER);
if (is_enable_file_modification_listening()) {
$this->router->read_files();
$this->interpretDirectory();
}
// if (is_enable_file_modification_listening()) {
// $this->router->read_files();
// $this->interpretDirectory();
// }
$this->mixed($event, true, $time);
}
+10 -6
View File
@@ -234,12 +234,16 @@ class Application extends BaseApplication
private function enableFileChange(Command $class, $input, $output): void
{
fire(new OnBeforeCommandExecute());
if (!($class instanceof ServerCommand)) {
scan_directory(directory('app'), 'App');
} else if (!is_enable_file_modification_listening()) {
$this->getRouter()->read_files();
scan_directory(directory('app'), 'App');
}
// if (!($class instanceof ServerCommand)) {
// scan_directory(directory('app'), 'App');
// } else if (!is_enable_file_modification_listening()) {
// $this->getRouter()->read_files();
// scan_directory(directory('app'), 'App');
// }
scan_directory(directory('app'), 'App');
if ($class instanceof ServerCommand) {
$this->getRouter()->read_files();
}
$class->run($input, $output);
$output->writeln('ok' . PHP_EOL);
}