This commit is contained in:
xl
2023-07-10 02:04:49 +08:00
parent d093dd7f57
commit 6ea25f35a4
+6 -1
View File
@@ -25,7 +25,7 @@ use Symfony\Component\Console\{Application as ConsoleApplication,
Output\ConsoleOutput, Output\ConsoleOutput,
Output\OutputInterface Output\OutputInterface
}; };
use Kiri\Server\Events\OnWorkerStart;
/** /**
* Class Init * Class Init
@@ -124,6 +124,11 @@ class Application extends BaseApplication
} else if (\config('reload.hot', false) === false) { } else if (\config('reload.hot', false) === false) {
$scanner = $container->get(Scanner::class); $scanner = $container->get(Scanner::class);
$scanner->read(APP_PATH . 'app/'); $scanner->read(APP_PATH . 'app/');
} else {
on(OnWorkerStart::class, function () {
$scanner = di(Scanner::class);
$scanner->read(APP_PATH . 'app/');
}, -1);
} }
fire(new OnBeforeCommandExecute()); fire(new OnBeforeCommandExecute());