Skip to content

Conversation

@zanussbaum
Copy link
Contributor

follows style of polling with requests

import time

max_polls = 300
check_url = data["request_check_url"]

for i in range(max_polls):
    time.sleep(2)
    response = requests.get(check_url, headers=headers) # Don't forget to send the auth headers
    data = response.json()

    if data["status"] == "complete":
        break

@zanussbaum zanussbaum changed the base branch from master to dev September 10, 2025 01:11
Copy link
Contributor

@voberoi voberoi left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @zanussbaum.

While you're at it, there's one more open issue related to polling that would be great to fix.

Should any of polls fail in _poll_result because of a flaky connection or intermittent error, the entire conversion fails outright, but it shouldn't.

We should have reasonable default retry behavior on each poll request. This issue tends to come up most when folks are running/testing things locally on flaky wifi.

@zanussbaum
Copy link
Contributor Author

@voberoi thanks for the suggestions! i added it as a separate function with tenacity. tests pass and was able to run on a doc locally as well. merging

@zanussbaum zanussbaum merged commit 3f12d51 into dev Sep 10, 2025
1 check passed
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.

3 participants