This commit is contained in:
2021-12-02 14:12:27 +08:00
parent 19c9b692d4
commit ce3647b5b7
2 changed files with 11 additions and 11 deletions
+10 -10
View File
@@ -95,16 +95,16 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa
*/
public function consulWatches(OnWorkerStart|OnTaskerStart $server)
{
Timer::tick(1000, static function () {
$lists = Kiri::getDi()->get(RpcManager::class)->doneList();
$health = Kiri::getDi()->get(Agent::class)->checks;
foreach ($lists as $list) {
$health->checks();
}
});
// Timer::tick(1000, static function () {
// $lists = Kiri::getDi()->get(RpcManager::class)->doneList();
// $health = Kiri::getDi()->get(Agent::class)->checks;
// foreach ($lists as $list) {
//
// $health->checks();
//
//
// }
// });
}
+1 -1
View File
@@ -28,7 +28,7 @@ class RpcManager
$methods = Kiri::getDi()->getReflect($class);
$lists = $methods->getMethods(\ReflectionMethod::IS_PUBLIC);
if (!isset($this->_rpc[$name])) $this->_rpc[$name] = ['methods' => [], 'id' => $serviceConfig['id'], 'config' => $serviceConfig];
if (!isset($this->_rpc[$name])) $this->_rpc[$name] = ['methods' => [], 'id' => $serviceConfig['ID'], 'config' => $serviceConfig];
foreach ($lists as $reflection) {
$methodName = $reflection->getName();