modify
This commit is contained in:
@@ -27,6 +27,7 @@ use Snowflake\Exception\NotFindClassException;
|
|||||||
use stdClass;
|
use stdClass;
|
||||||
use Swoole\Timer;
|
use Swoole\Timer;
|
||||||
use Wchat\WchatProviders;
|
use Wchat\WchatProviders;
|
||||||
|
use function Co\run;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Init
|
* Class Init
|
||||||
@@ -135,6 +136,7 @@ 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');
|
||||||
@@ -146,15 +148,11 @@ class Application extends BaseApplication
|
|||||||
}
|
}
|
||||||
response()->send($manager->execCommand($class));
|
response()->send($manager->execCommand($class));
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
var_export(current($exception->getTrace()));
|
response()->send(logger()->exception($exception));
|
||||||
response()->send(implode("\n", [
|
|
||||||
'Msg: ' . $exception->getMessage(),
|
|
||||||
'Line: ' . $exception->getLine(),
|
|
||||||
'File: ' . $exception->getFile()
|
|
||||||
]));
|
|
||||||
} finally {
|
} finally {
|
||||||
Timer::clearAll();
|
Timer::clearAll();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user