Skip to content

Commit

Permalink
close aiohttp session when disconnecting (Fixes #272)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Mar 18, 2022
1 parent 06480be commit a9fb317
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engineio/asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ async def disconnect(self, abort=False):
client.connected_clients.remove(self)
except ValueError: # pragma: no cover
pass
if self.http and not self.http.closed:
await self.http.close()
self._reset()

def start_background_task(self, target, *args, **kwargs):
Expand Down

0 comments on commit a9fb317

Please sign in to comment.