变更
This commit is contained in:
+4
-8
@@ -30,14 +30,12 @@ class RpcManager extends Component
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function reRegister(string $serviceName): void
|
||||
public function reRegister(): void
|
||||
{
|
||||
$config = $this->_rpc[$serviceName] ?? [];
|
||||
if (empty($config)) {
|
||||
return;
|
||||
}
|
||||
$service = Kiri::getDi()->get(Agent::class);
|
||||
|
||||
$config = Config::get("rpc.consul", null, true);
|
||||
|
||||
$info = $service->service->service_health($config['config']['ID']);
|
||||
if ($info->getStatusCode() == 200) {
|
||||
return;
|
||||
@@ -52,9 +50,7 @@ class RpcManager extends Component
|
||||
public function tick(): void
|
||||
{
|
||||
try {
|
||||
// foreach ($this->_rpc as $name => $list) {
|
||||
// $this->reRegister($name);
|
||||
// }
|
||||
$this->reRegister();
|
||||
} catch (\Throwable $throwable) {
|
||||
$this->logger->error(error_trigger_format($throwable));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user