From 53f375743e06a8edbdb955c32c3eb25779b714d3 Mon Sep 17 00:00:00 2001 From: JimZhang Date: Wed, 6 Mar 2024 14:20:21 +0800 Subject: [PATCH] fix: cannot choice hash set --- src/wrpc/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wrpc/helpers.py b/src/wrpc/helpers.py index 4c20f39..36b41b7 100644 --- a/src/wrpc/helpers.py +++ b/src/wrpc/helpers.py @@ -13,7 +13,7 @@ from .rpc import Rpc class RpcEndpoint: def __init__(self, rpc, endpoints, get_endpoints, target): self.__rpc = rpc - self.__endpoints = endpoints + self.__endpoints = list(endpoints) self.__get_endpoints = get_endpoints self.__target = target @@ -24,7 +24,7 @@ class RpcEndpoint: return functools.partial(getattr(self.__rpc, name), target=random.choice(self.__endpoints)) def set_endpoints(self, endpoints): - self.__endpoints = endpoints + self.__endpoints = list(endpoints) class AsyncHelper: