From 57c7df9ecb68ba7e7d696168deef55afa6003fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 17:26:15 +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 --- Annotation/Rpc/RpcService.php | 4 ++++ Rpc/Producer.php | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Annotation/Rpc/RpcService.php b/Annotation/Rpc/RpcService.php index 778e393c..9b317910 100644 --- a/Annotation/Rpc/RpcService.php +++ b/Annotation/Rpc/RpcService.php @@ -56,6 +56,10 @@ use Snowflake\Snowflake; $rpc = Snowflake::app()->getRpc(); $rpc->addProducer($this->cmd, $handler, $this->config); + if ($handler[0] instanceof IProducer) { + $handler[0]->initClient(); + } + return parent::execute($handler); } diff --git a/Rpc/Producer.php b/Rpc/Producer.php index 0d577489..e08be376 100644 --- a/Rpc/Producer.php +++ b/Rpc/Producer.php @@ -37,10 +37,6 @@ class Producer extends Component $this->consumers[$name] = $handler[0]; $this->producers[$name] = $node; - - if ($handler[0] instanceof IProducer) { - $handler[0]->initClient(); - } }