Skip to content

Commit b2a30fc

Browse files
committed
clarify retry loop
1 parent eb2906d commit b2a30fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

etcd3/baseclient.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def retry_all_hosts(func):
5555
def wrapper(self, *args, **kwargs):
5656
errors = []
5757
got_result = False
58-
for i in range(len(self.endpoints)):
58+
retries = len(self.endpoints)
59+
while retries > 0:
60+
retries -= 1
5961
endpoint = self.endpoints.pop(0)
6062
self.endpoints.append(endpoint)
6163
self.host = endpoint.host

0 commit comments

Comments
 (0)