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); $time = microtime(true);
ServerManager::setEnv('environmental', Kiri::TASK); ServerManager::setEnv('environmental', Kiri::TASK);
if (!is_enable_file_modification_listening()) { // if (!is_enable_file_modification_listening()) {
$this->interpretDirectory(); // $this->interpretDirectory();
} // }
$this->mixed($event, false, $time); $this->mixed($event, false, $time);
} }
+4 -4
View File
@@ -30,10 +30,10 @@ class OnWorkerStart extends WorkerStart implements EventDispatcherInterface
$time = microtime(true); $time = microtime(true);
ServerManager::setEnv('environmental', Kiri::WORKER); ServerManager::setEnv('environmental', Kiri::WORKER);
if (is_enable_file_modification_listening()) { // if (is_enable_file_modification_listening()) {
$this->router->read_files(); // $this->router->read_files();
$this->interpretDirectory(); // $this->interpretDirectory();
} // }
$this->mixed($event, true, $time); $this->mixed($event, true, $time);
} }
+7 -3
View File
@@ -234,11 +234,15 @@ class Application extends BaseApplication
private function enableFileChange(Command $class, $input, $output): void private function enableFileChange(Command $class, $input, $output): void
{ {
fire(new OnBeforeCommandExecute()); fire(new OnBeforeCommandExecute());
if (!($class instanceof ServerCommand)) { // 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'); scan_directory(directory('app'), 'App');
} else if (!is_enable_file_modification_listening()) { if ($class instanceof ServerCommand) {
$this->getRouter()->read_files(); $this->getRouter()->read_files();
scan_directory(directory('app'), 'App');
} }
$class->run($input, $output); $class->run($input, $output);
$output->writeln('ok' . PHP_EOL); $output->writeln('ok' . PHP_EOL);