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
{
run(function () use ($argv) {
try {
/** @var Console $manager */
$manager = Snowflake::app()->get('console');
$manager->register(Runtime::class);
$manager->setParameters($argv);
$class = $manager->search();
if (!($class instanceof Command)) {
scan_directory(directory('app'), 'App');
}
response()->send($manager->execCommand($class));
} catch (\Throwable $exception) {
response()->send(logger()->exception($exception));
} finally {
Timer::clearAll();
try {
/** @var Console $manager */
$manager = Snowflake::app()->get('console');
$manager->register(Runtime::class);
$manager->setParameters($argv);
$class = $manager->search();
if (!($class instanceof Command)) {
scan_directory(directory('app'), 'App');
}
});
response()->send($manager->execCommand($class));
} catch (\Throwable $exception) {
response()->send(logger()->exception($exception));
} finally {
Timer::clearAll();
}
}
/**