From 5393acd53900dd9b84dd0115612bd8dc11a89da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 29 Oct 2021 11:52:26 +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 --- src/RpcJsonp.php | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/RpcJsonp.php b/src/RpcJsonp.php index dcdc16a..0a0c8e3 100644 --- a/src/RpcJsonp.php +++ b/src/RpcJsonp.php @@ -70,26 +70,10 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa $config = Config::get('rpc'); $agent = Kiri::getDi()->get(Agent::class); - $data = $agent->service->register([ - "ID" => $config['name'] ?? 'test-name', - "Name" => "redis", - "Tags" => ["primary", "v1"], - "Address" => Kiri::localhost(), - "Port" => $config['port'], - "Meta" => [ - "redis_version" => "4.0" - ], - "EnableTagOverride" => false, - "Check" => [ - "Http" => "http://127.0.0.1:9527", - "Interval" => "1s" - ], - "Weights" => [ - "Passing" => 10, - "Warning" => 1 - ] - ]); - var_dump($data->getBody()->getContents()); + $data = $agent->service->register($config['registry']['config']); + if ($data->getStatusCode() != 200) { + exit($data->getBody()->getContents()); + } }