Skip to content

Conversation

@ahal
Copy link
Contributor

@ahal ahal commented May 21, 2025

Following Github's recommended practices for both the GraphQL and REST APIs.

Issue: #20

Following Github's recommended practices for both the GraphQL and REST
APIs.

Issue: mozilla-releng#20
@ahal ahal force-pushed the ahal/push-ulzwukurnyvp branch from ace209f to 4bb9164 Compare May 21, 2025 20:51
Copy link
Contributor

@jcristau jcristau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, thanks for doing this.

Comment on lines +73 to +75
wait_time = max(0, int(reset) - int(time()))
elif retry_after:
wait_time = int(retry_after)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handle ValueError from the casts?

while True:
with session.request(method, url, **kwargs) as resp:
if attempt <= self.MAX_RETRIES and is_rate_limited(resp):
time.sleep(get_wait_time(resp, attempt))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to log something before sleep?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants