Skip to content

Commit

Permalink
Retry Dimensions pubs query
Browse files Browse the repository at this point in the history
  • Loading branch information
lwrubel committed Jul 16, 2024
1 parent fe61779 commit fa63eba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rialto_airflow/harvest/dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def dois_from_orcid(orcid):
""".format(orcid)

# The Dimensions API can flake out sometimes, so try to catch & retry.
# TODO: Consider using retry param in query() instead
try_count = 0
while try_count < 20:
try_count += 1
Expand Down Expand Up @@ -82,7 +83,7 @@ def publications_from_dois(dois: list, batch_size=200):
limit 1000
"""

result = dsl().query(q)
result = dsl().query(q, retry=5)

for pub in result["publications"]:
yield normalize_publication(pub)
Expand Down
1 change: 1 addition & 0 deletions test/harvest/test_openalex.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def test_pyalex_urlencoding():
), "we handle url URL encoding DOIs until pyalex does"


@pytest.mark.skip(reason="This record no longer exhibits the problem")
def test_pyalex_varnish_bug():
# it seems like this author has a few records that are so big they blow out
# OpenAlex's Varnish index. See https://groups.google.com/u/1/g/openalex-community/c/hl09WRF3Naw
Expand Down

0 comments on commit fa63eba

Please sign in to comment.