Loading src/Aspect/AsyncCoroutineAspect.php +17 −15 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ class AsyncCoroutineAspect extends AbstractAspect // $proceedingJoinPoint 为连接点,通过该类的 process() 方法调用原方法并获得结果 // 在调用前进行某些处理 return Coroutine::create(function ()use($proceedingJoinPoint){ try { LogTraceHandler::recordProcess( '投递到子协程任务,id:'.Coroutine::id() .' ,类:'.$proceedingJoinPoint->className Loading @@ -44,7 +44,9 @@ class AsyncCoroutineAspect extends AbstractAspect '子协程任务id:'.Coroutine::id().'已完成,执行结果:'. json_encode($result),true ); }catch (\Throwable $exception){ LogTraceHandler::recordProcess($exception,true); } }); Loading src/Aspect/LogTraceAspect.php +16 −11 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class LogTraceAspect extends AbstractAspect public function process(ProceedingJoinPoint $proceedingJoinPoint) { try { $originParams = [ 'called_params'=>$proceedingJoinPoint->getArguments(), 'http_params'=>make(RequestInterface::class)->all() Loading @@ -39,5 +39,10 @@ class LogTraceAspect extends AbstractAspect LogTraceHandler::recordProcess('返回结果:'.json_encode($result)); return $result; }catch (\Throwable $exception){ LogTraceHandler::recordProcess($exception); throw $exception ; //保持异常抛出 } } } No newline at end of file src/Handler/LogTrace/LogTraceHandler.php +0 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ class LogTraceHandler /** * 程序执行完成标记结束 * @throws \Exception */ public static function markComplete() { Loading Loading
src/Aspect/AsyncCoroutineAspect.php +17 −15 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ class AsyncCoroutineAspect extends AbstractAspect // $proceedingJoinPoint 为连接点,通过该类的 process() 方法调用原方法并获得结果 // 在调用前进行某些处理 return Coroutine::create(function ()use($proceedingJoinPoint){ try { LogTraceHandler::recordProcess( '投递到子协程任务,id:'.Coroutine::id() .' ,类:'.$proceedingJoinPoint->className Loading @@ -44,7 +44,9 @@ class AsyncCoroutineAspect extends AbstractAspect '子协程任务id:'.Coroutine::id().'已完成,执行结果:'. json_encode($result),true ); }catch (\Throwable $exception){ LogTraceHandler::recordProcess($exception,true); } }); Loading
src/Aspect/LogTraceAspect.php +16 −11 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class LogTraceAspect extends AbstractAspect public function process(ProceedingJoinPoint $proceedingJoinPoint) { try { $originParams = [ 'called_params'=>$proceedingJoinPoint->getArguments(), 'http_params'=>make(RequestInterface::class)->all() Loading @@ -39,5 +39,10 @@ class LogTraceAspect extends AbstractAspect LogTraceHandler::recordProcess('返回结果:'.json_encode($result)); return $result; }catch (\Throwable $exception){ LogTraceHandler::recordProcess($exception); throw $exception ; //保持异常抛出 } } } No newline at end of file
src/Handler/LogTrace/LogTraceHandler.php +0 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ class LogTraceHandler /** * 程序执行完成标记结束 * @throws \Exception */ public static function markComplete() { Loading