diff options
| author | Rapptz <[email protected]> | 2020-09-07 21:50:00 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-09-23 03:21:18 -0400 |
| commit | 0ea0f483bc8174e9350d3322576d562a49bb3858 (patch) | |
| tree | 572e558d185875d2ab42fad878a8462acf199adb | |
| parent | Maximize the amount of concurrency while chunking. (diff) | |
| download | discord.py-0ea0f483bc8174e9350d3322576d562a49bb3858.tar.xz discord.py-0ea0f483bc8174e9350d3322576d562a49bb3858.zip | |
Fix timeouts due to hitting the gateway rate limit
| -rw-r--r-- | discord/state.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/state.py b/discord/state.py index 760a9a8e..08863336 100644 --- a/discord/state.py +++ b/discord/state.py @@ -753,7 +753,7 @@ class ConnectionState: self._chunk_requests.append(request) await self.chunker(guild.id, nonce=request.nonce) if wait: - await request.future + return await request.future return request.future 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) if len(current_bucket) >= max_concurrency: 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: 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)) |