Don't retry forever on TcpClient.connect()

This commit is contained in:
Lonami Exo 2018-04-25 10:06:11 +02:00
parent 5d9cf513bd
commit e2a0de1913

View File

@ -91,7 +91,9 @@ class TcpClient:
# to none to recreate it on the next iteration
self._socket = None
time.sleep(timeout)
timeout = min(timeout * 2, MAX_TIMEOUT)
timeout *= 2
if timeout > MAX_TIMEOUT:
raise
else:
raise