Fix AttributeError on reconnection
This commit is contained in:
parent
3afbbf5e47
commit
45cb231161
@ -40,9 +40,9 @@ from .enums import Status
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class EventType:
|
class EventType:
|
||||||
Close = 0
|
close = 0
|
||||||
Resume = 1
|
resume = 1
|
||||||
Identify = 2
|
identify = 2
|
||||||
|
|
||||||
class Shard:
|
class Shard:
|
||||||
def __init__(self, ws, client):
|
def __init__(self, ws, client):
|
||||||
@ -61,7 +61,7 @@ class Shard:
|
|||||||
self._task = self.loop.create_task(self.worker())
|
self._task = self.loop.create_task(self.worker())
|
||||||
|
|
||||||
async def worker(self):
|
async def worker(self):
|
||||||
while True:
|
while not self._client.is_closed():
|
||||||
try:
|
try:
|
||||||
await self.ws.poll_event()
|
await self.ws.poll_event()
|
||||||
except ReconnectWebSocket as e:
|
except ReconnectWebSocket as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user