Skip to content

Commit

Permalink
clarify retry loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dariko committed Feb 25, 2019
1 parent 7a61e92 commit 7b33a71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion etcd3/baseclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def retry_all_hosts(func):
def wrapper(self, *args, **kwargs):
errors = []
got_result = False
for i in range(len(self.endpoints)):
retries = len(self.endpoints)
while retries > 0:
retries -= 1
endpoint = self.endpoints.pop(0)
self.endpoints.append(endpoint)
self.host = endpoint.host
Expand Down

0 comments on commit 7b33a71

Please sign in to comment.