Skip to content

Commit

Permalink
fix: Remove illegal keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
sondrelg committed Aug 5, 2023
1 parent e8d68b5 commit 04c70fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def wait_for_rate_limit(*, response: Response, eligible_for_secondary_limi
See docs on rate limits: https://docs.github.com/en/rest/rate-limit?apiVersion=2022-11-28.
"""
if int(response.headers.get('x-ratelimit-remaining', default=1)) == 0:
if int(response.headers.get('x-ratelimit-remaining', 1)) == 0:
ratelimit_reset = datetime.fromtimestamp(int(response.headers['x-ratelimit-reset']))
delta = ratelimit_reset - datetime.now()

Expand All @@ -89,7 +89,7 @@ async def wait_for_rate_limit(*, response: Response, eligible_for_secondary_limi
elif eligible_for_secondary_limit:
# https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#secondary-rate-limits
# https://docs.github.com/en/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits
if int(response.headers.get('retry-after', default=1)) == 0:
if int(response.headers.get('retry-after', 1)) == 0:
ratelimit_reset = datetime.fromtimestamp(int(response.headers['retry-after']))
delta = ratelimit_reset - datetime.now()
if delta > timedelta(seconds=MAX_SLEEP):
Expand Down

0 comments on commit 04c70fd

Please sign in to comment.