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:
replies = []
if len(endpoints) > 0:
for endpoint in endpoints:
async with aiohttp.ClientSession() as session:
for endpoint in endpoints:
self._logger.debug("Trying to connect to: " + str(endpoint))
_client = client.Client(
endpoint, session, proxy=self._user_parameters.proxy()
......@@ -374,6 +374,7 @@ class BmaConnector:
replies.append(reply)
result = await asyncio.gather(*replies, return_exceptions=True)
return tuple(result)
else:
raise NoPeerAvailable("", len(endpoints))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment