From 6a085db0b43231f04342a76c8904ba5a289635c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 22 Apr 2021 14:02:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Events/OnRequest.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/HttpServer/Events/OnRequest.php b/HttpServer/Events/OnRequest.php index 7195dd70..1ad03fed 100644 --- a/HttpServer/Events/OnRequest.php +++ b/HttpServer/Events/OnRequest.php @@ -4,21 +4,16 @@ declare(strict_types=1); namespace HttpServer\Events; -use Annotation\Aspect; -use Database\InjectProperty; use Exception; use HttpServer\Abstracts\Callback; use HttpServer\Exception\ExitException; use HttpServer\Http\Request as HRequest; use HttpServer\Http\Response as HResponse; use ReflectionException; -use Snowflake\Core\Json; use Snowflake\Error\Logger; use Snowflake\Event; -use Snowflake\Exception\ComponentException; use Snowflake\Exception\NotFindClassException; use Snowflake\Snowflake; -use Swoole\Coroutine; use Swoole\Error; use Swoole\Http\Request; use Swoole\Http\Response; @@ -54,9 +49,9 @@ class OnRequest extends Callback public function onHandler(Request $request, Response $response): mixed { try { - -// var_dump(Coroutine::printBackTrace()); - + if (function_exists('trackerAnalyzeLeak')) { + trackerAnalyzeLeak(); + } /** @var HRequest $request */ [$request, $response] = OnRequest::createContext($request, $response); @@ -99,7 +94,7 @@ class OnRequest extends Callback */ protected function sendErrorMessage($sRequest, $sResponse, $exception): bool|string { - $this->addError($exception,'throwable'); + $this->addError($exception, 'throwable'); if ($sResponse instanceof Response) { [$sRequest, $sResponse] = [HRequest::create($sRequest), HResponse::create($sResponse)]; }