Browse Source

Fix timeouts due to hitting the gateway rate limit

pull/5849/head
Rapptz 5 years ago
parent
commit
0ea0f483bc
  1. 4
      discord/state.py

4
discord/state.py

@ -753,7 +753,7 @@ class ConnectionState:
self._chunk_requests.append(request) self._chunk_requests.append(request)
await self.chunker(guild.id, nonce=request.nonce) await self.chunker(guild.id, nonce=request.nonce)
if wait: if wait:
await request.future return await request.future
return request.future return request.future
async def _chunk_and_dispatch(self, guild, unavailable): async def _chunk_and_dispatch(self, guild, unavailable):
@ -1063,7 +1063,7 @@ class AutoShardedConnectionState(ConnectionState):
log.debug('Guild ID %d requires chunking, will be done in the background.', guild.id) log.debug('Guild ID %d requires chunking, will be done in the background.', guild.id)
if len(current_bucket) >= max_concurrency: if len(current_bucket) >= max_concurrency:
try: try:
await utils.sane_wait_for(current_bucket, timeout=max_concurrency * 10) await utils.sane_wait_for(current_bucket, timeout=max_concurrency * 70.0)
except asyncio.TimeoutError: except asyncio.TimeoutError:
fmt = 'Shard ID %s failed to wait for chunks from a sub-bucket with length %d' fmt = 'Shard ID %s failed to wait for chunks from a sub-bucket with length %d'
log.warning(fmt, self.shard_id, len(current_bucket)) log.warning(fmt, self.shard_id, len(current_bucket))

Loading…
Cancel
Save