fix: cannot choice hash set

master
JimZhang 10 months ago
parent 1425e8e33c
commit 53f375743e

@ -13,7 +13,7 @@ from .rpc import Rpc
class RpcEndpoint: class RpcEndpoint:
def __init__(self, rpc, endpoints, get_endpoints, target): def __init__(self, rpc, endpoints, get_endpoints, target):
self.__rpc = rpc self.__rpc = rpc
self.__endpoints = endpoints self.__endpoints = list(endpoints)
self.__get_endpoints = get_endpoints self.__get_endpoints = get_endpoints
self.__target = target self.__target = target
@ -24,7 +24,7 @@ class RpcEndpoint:
return functools.partial(getattr(self.__rpc, name), target=random.choice(self.__endpoints)) return functools.partial(getattr(self.__rpc, name), target=random.choice(self.__endpoints))
def set_endpoints(self, endpoints): def set_endpoints(self, endpoints):
self.__endpoints = endpoints self.__endpoints = list(endpoints)
class AsyncHelper: class AsyncHelper:

Loading…
Cancel
Save