diff --git a/src/aiocraft/dispatcher.py b/src/aiocraft/dispatcher.py index 103265a..920e6f8 100644 --- a/src/aiocraft/dispatcher.py +++ b/src/aiocraft/dispatcher.py @@ -273,7 +273,7 @@ class Dispatcher: await self.disconnect(block=False) async def _up_worker(self, timeout=1): - while True: + while self._dispatching: try: packet : Packet = await asyncio.wait_for(self._outgoing.get(), timeout=timeout) except asyncio.TimeoutError: