From a289c164223a7678b164d07e6d179ea5b02d5952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 29 Mar 2021 18:45:05 +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 --- Rpc/Client.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Rpc/Client.php b/Rpc/Client.php index 08a6c9b8..ed8f37df 100644 --- a/Rpc/Client.php +++ b/Rpc/Client.php @@ -52,12 +52,10 @@ class Client extends Component if ($isSend === false) { return $this->addError($this->client->errMsg . '(' . $this->client->errCode . ')'); } - \Swoole\Coroutine\defer(function () { - $this->recover(); - }); if (is_bool($unpack = Json::decode($this->client->recv()))) { - return $this->addError('Service return data format error(500)'); + $unpack = $this->addError('Service return data format error(500)'); } + $this->clientRecover(); return $unpack; } @@ -68,7 +66,7 @@ class Client extends Component * @throws NotFindClassException * @throws Exception */ - public function recover(): static + public function clientRecover(): static { /** @var Channel $channel */ $channel = Snowflake::app()->get('channel');