forked from LBRYCommunity/lbry-sdk
use only the main session, dont cancel on connectionerror
This commit is contained in:
parent
b9b8178e30
commit
9cfa9b2c57
1 changed files with 5 additions and 3 deletions
|
@ -78,7 +78,7 @@ class ClientSession(BaseClientSession):
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
log.warning("connection to %s:%i lost", *self.server)
|
log.warning("connection to %s:%i lost", *self.server)
|
||||||
self.synchronous_close()
|
self.synchronous_close()
|
||||||
raise asyncio.CancelledError(f"connection to {self.server[0]}:{self.server[1]} lost")
|
raise
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
log.info("timeout sending %s to %s:%i", method, *self.server)
|
log.info("timeout sending %s to %s:%i", method, *self.server)
|
||||||
raise
|
raise
|
||||||
|
@ -203,8 +203,10 @@ class BaseNetwork:
|
||||||
return self.client and not self.client.is_closing()
|
return self.client and not self.client.is_closing()
|
||||||
|
|
||||||
def rpc(self, list_or_method, args, session=None):
|
def rpc(self, list_or_method, args, session=None):
|
||||||
session = session or self.session_pool.fastest_session
|
# fixme: use fastest unloaded session, but for now it causes issues with wallet sync
|
||||||
if session:
|
# session = session or self.session_pool.fastest_session
|
||||||
|
session = self.client
|
||||||
|
if session and not session.is_closing():
|
||||||
return session.send_request(list_or_method, args)
|
return session.send_request(list_or_method, args)
|
||||||
else:
|
else:
|
||||||
self.session_pool.trigger_nodelay_connect()
|
self.session_pool.trigger_nodelay_connect()
|
||||||
|
|
Loading…
Reference in a new issue