Reinforce websocket logic;

so that it doesn't change to disconnected after a long no-internet period
This commit is contained in:
DevilXD committed 2022-08-03 22:16:57 +02:00
1 parent 39d45360e6
commit b8cba528b5
2 files changed
+26 -26

No files matched your search

+2
View File
@@ -203,6 +203,8 @@ class Twitch:
# clear the flag and wait until it's set again
self._state_change.clear()
elif self._state is State.INVENTORY_FETCH:
# ensure the websocket is running
await self.websocket.start()
# NOTE: maintenance task is restarted on inventory fetch
if self._mnt_task is not None and not self._mnt_task.done():
self._mnt_task.cancel()