Skip to content

Update tools_validator.py - #1859

Draft
bianchini88 wants to merge 3 commits into
masterfrom
FAIRsharing_API_rate
Draft

Update tools_validator.py#1859
bianchini88 wants to merge 3 commits into
masterfrom
FAIRsharing_API_rate

Conversation

@bianchini88

Copy link
Copy Markdown
Collaborator

Adding a delay to account for rate limit on FAIRsharing's API

Adding a delay to account for rate limit on FAIRsharing's APi
Comment thread var/tools_validator.py Outdated
@bianchini88

Copy link
Copy Markdown
Collaborator Author

With a 5-second delay, things work until we get a 500 Internal Server Error. Rerunning.

Comment thread var/tools_validator.py
registry['fairsharing'] = check_fairsharing
if 'fairsharing' in registry.keys() and not registry['fairsharing']:
del registry['fairsharing']
time.sleep(5) # to avoid issues with rate limit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ooof I am not a fan of this solution. This will increase the general time way to much no? I assume we can do something more clever on the requests side, or keeping track of the number of requests we've already done.

@bedroesb

Copy link
Copy Markdown
Member

@bianchini88 You have better contacts with FAIRsharing, can this not be solved on their end? I understand rate limits for unauthenticated requests, but we are authenticated, and only doing around 1000 requests over 10min. This does not feel like a hard ask. I am not comfortable putting sleeps like this in the code

@bianchini88

Copy link
Copy Markdown
Collaborator Author

Crashed twice at European Joint Programme on Rare Diseases Metadata Model, which should get https://fairsharing.org/FAIRsharing.3e0038. Not sure about the issue.

@bianchini88

Copy link
Copy Markdown
Collaborator Author

Hi @bedroesb. This was meant as a temporary fix for the summer, but it does not look like it is working anyway (and I am off in 15 minutes to catch a flight). FAIRsharing recommends that we transition to the GraphQL API and the 'advancedSearchFast' query (https://api.fairsharing.org/schema/query.doc.html).

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