Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception upon 429 response code #195

Closed
oripka opened this issue Jul 26, 2022 · 0 comments
Closed

Exception upon 429 response code #195

oripka opened this issue Jul 26, 2022 · 0 comments

Comments

@oripka
Copy link

oripka commented Jul 26, 2022

The variable retry_after is not converted into a number before passing it into the sleep() function. This causes an error when a 429 response code with the retry-after header is received. time.sleep(int(retry_after)) might be enough to deal with this.

[/usr/local/lib/python3.7/dist-packages/wikidataintegrator/wdi_core.py](https://localhost:8080/#) in execute_sparql_query(query, prefix, endpoint, user_agent, as_dataframe, max_retries, retry_after)
    131                     retry_after = response.headers["retry-after"]
    132                 print("service unavailable. sleeping for {} seconds".format(retry_after))
--> 133                 time.sleep(retry_after)
    134                 continue
    135             response.raise_for_status()

TypeError: an integer is required (got type str)
oripka added a commit to oripka/WikidataIntegrator that referenced this issue Jul 27, 2022
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

No branches or pull requests

1 participant