We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2685516 commit 4125f10Copy full SHA for 4125f10
discord/http.py
@@ -461,7 +461,12 @@ async def acquire(self) -> None:
461
future = self._loop.create_future()
462
self._pending_requests.append(future)
463
try:
464
- await future
+ while not future.done():
465
+ # 30 matches the smallest allowed max_ratelimit_timeout
466
+ max_wait_time = self.expires - self._loop.time() if self.expires else 30
467
+ await asyncio.wait([future], timeout=max_wait_time)
468
+ if not future.done():
469
+ await self._refresh()
470
except:
471
future.cancel()
472
if self.remaining > 0 and not future.cancelled():
0 commit comments