Skip to content

Commit 0ba3766

Browse files
authored
Merge pull request #247 from mcmtroffaes/patch-1
Close http session when bot closes.
2 parents b5eb585 + efce226 commit 0ba3766

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

twitchio/websocket.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,5 +483,8 @@ async def _close(self):
483483
for fut in futures:
484484
fut.cancel()
485485

486-
await self._websocket.close()
486+
if self._websocket:
487+
await self._websocket.close()
488+
if self._client._http.session:
489+
await self._client._http.session.close()
487490
self._loop.stop()

0 commit comments

Comments
 (0)