Skip to content
Snippets Groups Projects
Commit fdeba31a authored by Vincent Texier's avatar Vincent Texier
Browse files

[fix] fix session closed error

parent 1fe751b5
No related branches found
No related tags found
No related merge requests found
...@@ -364,8 +364,8 @@ class BmaConnector: ...@@ -364,8 +364,8 @@ class BmaConnector:
replies = [] replies = []
if len(endpoints) > 0: if len(endpoints) > 0:
for endpoint in endpoints: async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession() as session: for endpoint in endpoints:
self._logger.debug("Trying to connect to: " + str(endpoint)) self._logger.debug("Trying to connect to: " + str(endpoint))
_client = client.Client( _client = client.Client(
endpoint, session, proxy=self._user_parameters.proxy() endpoint, session, proxy=self._user_parameters.proxy()
...@@ -373,7 +373,8 @@ class BmaConnector: ...@@ -373,7 +373,8 @@ class BmaConnector:
reply = asyncio.ensure_future(_client(request, **req_args)) reply = asyncio.ensure_future(_client(request, **req_args))
replies.append(reply) replies.append(reply)
result = await asyncio.gather(*replies, return_exceptions=True) result = await asyncio.gather(*replies, return_exceptions=True)
return tuple(result) return tuple(result)
else: else:
raise NoPeerAvailable("", len(endpoints)) raise NoPeerAvailable("", len(endpoints))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment