increase retry delay in ensure_session

This commit is contained in:
Jack Robison 2020-01-23 17:02:34 -05:00
parent 65d9dca917
commit 524961979d
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -87,7 +87,7 @@ class ClientSession(BaseClientSession):
async def ensure_session(self):
# Handles reconnecting and maintaining a session alive
# TODO: change to 'ping' on newer protocol (above 1.2)
retry_delay = default_delay = 1.0
retry_delay = default_delay = 300.0
while True:
try:
if self.is_closing():
@ -107,7 +107,6 @@ class ClientSession(BaseClientSession):
log.debug("Wallet server has an incompatible version, retrying in 1h: %s:%d", *self.server)
except (asyncio.TimeoutError, OSError):
await self.close()
retry_delay = min(60, retry_delay * 2)
log.debug("Wallet server timeout (retry in %s seconds): %s:%d", retry_delay, *self.server)
try:
await asyncio.wait_for(self.trigger_urgent_reconnect.wait(), timeout=retry_delay)