This commit is contained in:
as2252258@163.com
2021-04-25 01:36:22 +08:00
parent e836f96dff
commit 4c88e2851a
+14 -16
View File
@@ -136,23 +136,21 @@ class Application extends BaseApplication
*/ */
public function start(Input $argv): void public function start(Input $argv): void
{ {
run(function () use ($argv) { try {
try { /** @var Console $manager */
/** @var Console $manager */ $manager = Snowflake::app()->get('console');
$manager = Snowflake::app()->get('console'); $manager->register(Runtime::class);
$manager->register(Runtime::class); $manager->setParameters($argv);
$manager->setParameters($argv); $class = $manager->search();
$class = $manager->search(); if (!($class instanceof Command)) {
if (!($class instanceof Command)) { scan_directory(directory('app'), 'App');
scan_directory(directory('app'), 'App');
}
response()->send($manager->execCommand($class));
} catch (\Throwable $exception) {
response()->send(logger()->exception($exception));
} finally {
Timer::clearAll();
} }
}); response()->send($manager->execCommand($class));
} catch (\Throwable $exception) {
response()->send(logger()->exception($exception));
} finally {
Timer::clearAll();
}
} }
/** /**