Skip to content

Commit

Permalink
心跳检测异常
Browse files Browse the repository at this point in the history
直接传入service_name和group_name进行心跳检测,会频繁出现服务健康状态无刷新。使用 group_name@@service_name的标准服务名无此现象。
  • Loading branch information
nightosong authored Jul 11, 2024
1 parent 8c8977d commit 48390db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nacos/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,9 @@ def send_heartbeat(self, service_name, ip, port, cluster_name=None, weight=1.0,
group_name=DEFAULT_GROUP_NAME):
logger.info("[send-heartbeat] ip:%s, port:%s, service_name:%s, namespace:%s" % (ip, port, service_name,
self.namespace))
if "@@" not in service_name and group_name:
service_name = group_name + "@@" + service_name

beat_data = {
"serviceName": service_name,
"ip": ip,
Expand Down Expand Up @@ -1287,4 +1290,4 @@ def stop_subscribe(self):
stop subscribe timer scheduler
:return:
"""
self.subscribe_timer_manager.stop()
self.subscribe_timer_manager.stop()

0 comments on commit 48390db

Please sign in to comment.