From cb463c3e7c1fc0f65b04d5ff38662284d5a92964 Mon Sep 17 00:00:00 2001 From: huangzhhui Date: Thu, 12 Mar 2020 11:16:52 +0800 Subject: [PATCH 1/2] Fixed #1239 --- src/redis/src/RedisProxy.php | 6 ++++++ src/tracer/src/Aspect/RedisAspect.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/redis/src/RedisProxy.php b/src/redis/src/RedisProxy.php index 9e59a953e..39ea0afc9 100644 --- a/src/redis/src/RedisProxy.php +++ b/src/redis/src/RedisProxy.php @@ -24,4 +24,10 @@ class RedisProxy extends Redis $this->poolName = $pool; } + + public function __call($name, $arguments) + { + return parent::__call($name, $arguments); + } + } diff --git a/src/tracer/src/Aspect/RedisAspect.php b/src/tracer/src/Aspect/RedisAspect.php index 5caf6805f..32529be77 100644 --- a/src/tracer/src/Aspect/RedisAspect.php +++ b/src/tracer/src/Aspect/RedisAspect.php @@ -16,6 +16,7 @@ use Hyperf\Di\Annotation\Aspect; use Hyperf\Di\Aop\AroundInterface; use Hyperf\Di\Aop\ProceedingJoinPoint; use Hyperf\Redis\Redis; +use Hyperf\Redis\RedisProxy; use Hyperf\Tracer\SpanStarter; use Hyperf\Tracer\SpanTagManager; use Hyperf\Tracer\SwitchManager; @@ -34,6 +35,7 @@ class RedisAspect implements AroundInterface public $classes = [ Redis::class . '::__call', + RedisProxy::class . '::__call', ]; /** From c01c08541bd76cea89ce7ae65032c3bc7e516acc Mon Sep 17 00:00:00 2001 From: huangzhhui Date: Thu, 12 Mar 2020 11:21:26 +0800 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d2ed0384..25b86a3ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ## Fixed - [#1405](https://github.com/hyperf/hyperf/pull/1405) Fixed attributes are not right, when the model has property `hidden`. +- [#1410](https://github.com/hyperf/hyperf/pull/1410) Fixed tracer cannot trace the call chains of redis connection that created by `Hyperf\Redis\RedisFactory`. # v1.1.19 - 2020-03-05