Skip to content

Commit 20055e7

Browse files
authored
Fix calculation of hashed rate limit keys
1 parent a62b25c commit 20055e7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

discord/http.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,14 +673,13 @@ async def request(
673673
_log.debug(fmt, route_key, bucket_hash, discord_hash)
674674

675675
self._bucket_hashes[route_key] = discord_hash
676-
recalculated_key = discord_hash + route.major_parameters
677-
self._buckets[recalculated_key] = ratelimit
676+
self._buckets[f'{discord_hash}:{route.major_parameters}'] = ratelimit
678677
self._buckets.pop(key, None)
679678
elif route_key not in self._bucket_hashes:
680679
fmt = '%s has found its initial rate limit bucket hash (%s).'
681680
_log.debug(fmt, route_key, discord_hash)
682681
self._bucket_hashes[route_key] = discord_hash
683-
self._buckets[discord_hash + route.major_parameters] = ratelimit
682+
self._buckets[f'{discord_hash}:{route.major_parameters}'] = ratelimit
684683

685684
if has_ratelimit_headers:
686685
if response.status != 429:

0 commit comments

Comments
 (0)