Skip to content

Commit

Permalink
Increased retry count for flaky DNS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza committed Oct 24, 2024
1 parent d4b5c48 commit 516aeb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions paperqa/clients/crossref.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_crossref_mailto() -> str:
@retry(
retry=retry_if_exception(make_flaky_ssl_error_predicate(CROSSREF_HOST)),
before_sleep=before_sleep_log(logger, logging.WARNING),
stop=stop_after_attempt(3),
stop=stop_after_attempt(5),
)
async def doi_to_bibtex(
doi: str,
Expand Down Expand Up @@ -239,7 +239,7 @@ async def parse_crossref_to_doc_details(
@retry(
retry=retry_if_exception(make_flaky_ssl_error_predicate(CROSSREF_HOST)),
before_sleep=before_sleep_log(logger, logging.WARNING),
stop=stop_after_attempt(3),
stop=stop_after_attempt(5),
)
async def get_doc_details_from_crossref( # noqa: PLR0912
session: aiohttp.ClientSession,
Expand Down
4 changes: 2 additions & 2 deletions paperqa/clients/semantic_scholar.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def make_url_params( # noqa: PLR0911
@retry(
retry=retry_if_exception(make_flaky_ssl_error_predicate(SEMANTIC_SCHOLAR_HOST)),
before_sleep=before_sleep_log(logger, logging.WARNING),
stop=stop_after_attempt(3),
stop=stop_after_attempt(5),
)
async def _s2_get_with_retrying(url: str, **get_kwargs) -> dict[str, Any]:
return await _get_with_retrying(
Expand Down Expand Up @@ -270,7 +270,7 @@ async def s2_title_search(
@retry(
retry=retry_if_exception(make_flaky_ssl_error_predicate(SEMANTIC_SCHOLAR_HOST)),
before_sleep=before_sleep_log(logger, logging.WARNING),
stop=stop_after_attempt(3),
stop=stop_after_attempt(5),
)
async def get_s2_doc_details_from_doi(
doi: str | None,
Expand Down

0 comments on commit 516aeb5

Please sign in to comment.