|
@ -1029,6 +1029,7 @@ class AutoShardedConnectionState(ConnectionState): |
|
|
def __init__(self, *args, **kwargs): |
|
|
def __init__(self, *args, **kwargs): |
|
|
super().__init__(*args, **kwargs) |
|
|
super().__init__(*args, **kwargs) |
|
|
self._ready_task = None |
|
|
self._ready_task = None |
|
|
|
|
|
self.shard_ids = () |
|
|
|
|
|
|
|
|
async def request_offline_members(self, guilds, *, shard_id): |
|
|
async def request_offline_members(self, guilds, *, shard_id): |
|
|
# get all the chunks |
|
|
# get all the chunks |
|
@ -1051,10 +1052,10 @@ class AutoShardedConnectionState(ConnectionState): |
|
|
async def _delay_ready(self): |
|
|
async def _delay_ready(self): |
|
|
launch = self._ready_state.launch |
|
|
launch = self._ready_state.launch |
|
|
while True: |
|
|
while True: |
|
|
# this snippet of code is basically waiting 2 seconds |
|
|
# this snippet of code is basically waiting 2 * shard_ids seconds |
|
|
# until the last GUILD_CREATE was sent |
|
|
# until the last GUILD_CREATE was sent |
|
|
try: |
|
|
try: |
|
|
await asyncio.wait_for(launch.wait(), timeout=2.0) |
|
|
await asyncio.wait_for(launch.wait(), timeout=2.0 * len(self.shard_ids)) |
|
|
except asyncio.TimeoutError: |
|
|
except asyncio.TimeoutError: |
|
|
break |
|
|
break |
|
|
else: |
|
|
else: |
|
|