From 73d9865519db6798936603db4d049542d76f3336 Mon Sep 17 00:00:00 2001 From: CZJCC Date: Tue, 7 Jan 2025 10:05:42 +0800 Subject: [PATCH] fix bug --- setup.py | 2 +- v2/nacos/transport/nacos_server_connector.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 234400a..4a8403b 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ def run(self): setup( name="nacos-sdk-python", - version="2.0.0.beta5", + version="2.0.0.beta7", packages=find_packages( exclude=["test", "*.tests", "*.tests.*", "tests.*", "tests"]), url="https://github.com/nacos-group/nacos-sdk-python", diff --git a/v2/nacos/transport/nacos_server_connector.py b/v2/nacos/transport/nacos_server_connector.py index bcd4a1c..ee24867 100644 --- a/v2/nacos/transport/nacos_server_connector.py +++ b/v2/nacos/transport/nacos_server_connector.py @@ -32,6 +32,9 @@ def __init__(self, logger, client_config: ClientConfig, http_agent: HttpAgent): asyncio.create_task(self.auth_client.get_access_token(True)) async def init(self): + if len(self.server_list) != 0: + return + await self._get_server_list_from_endpoint() if len(self.server_list) == 0: raise NacosException(INVALID_SERVER_STATUS, "server list is empty")