increase retry delay in ensure_session
This commit is contained in:
parent
65d9dca917
commit
524961979d
1 changed files with 1 additions and 2 deletions
|
@ -87,7 +87,7 @@ class ClientSession(BaseClientSession):
|
||||||
async def ensure_session(self):
|
async def ensure_session(self):
|
||||||
# Handles reconnecting and maintaining a session alive
|
# Handles reconnecting and maintaining a session alive
|
||||||
# TODO: change to 'ping' on newer protocol (above 1.2)
|
# TODO: change to 'ping' on newer protocol (above 1.2)
|
||||||
retry_delay = default_delay = 1.0
|
retry_delay = default_delay = 300.0
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
if self.is_closing():
|
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)
|
log.debug("Wallet server has an incompatible version, retrying in 1h: %s:%d", *self.server)
|
||||||
except (asyncio.TimeoutError, OSError):
|
except (asyncio.TimeoutError, OSError):
|
||||||
await self.close()
|
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)
|
log.debug("Wallet server timeout (retry in %s seconds): %s:%d", retry_delay, *self.server)
|
||||||
try:
|
try:
|
||||||
await asyncio.wait_for(self.trigger_urgent_reconnect.wait(), timeout=retry_delay)
|
await asyncio.wait_for(self.trigger_urgent_reconnect.wait(), timeout=retry_delay)
|
||||||
|
|
Loading…
Add table
Reference in a new issue