Skip to content

Conversation

mskarlin
Copy link
Collaborator

Our default timeouts were not long enough for Crossref. This ups the default and makes it a configurable variable.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 18, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses timeout issues with external API clients by making timeout values configurable through environment variables and increasing default timeout values. The changes ensure that clients can handle slower API responses, particularly from Crossref.

  • Updates default timeout values from 5.0/10.0 seconds to a configurable 10.0 seconds default
  • Makes timeout values configurable via environment variables for each client
  • Converts hardcoded timeout constants to dynamically loaded values from environment

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
paperqa/clients/crossref.py Updates timeout from 5.0 to configurable 10.0 seconds via CROSSREF_API_REQUEST_TIMEOUT environment variable
paperqa/clients/openalex.py Updates timeout from 5.0 to configurable 10.0 seconds via OPENALEX_API_REQUEST_TIMEOUT environment variable
paperqa/clients/semantic_scholar.py Makes existing 10.0 second timeout configurable via SEMANTIC_SCHOLAR_API_REQUEST_TIMEOUT environment variable

@dosubot dosubot bot added the enhancement New feature or request label Jul 18, 2025
@mskarlin mskarlin requested a review from nadolskit July 18, 2025 18:05
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 18, 2025
@mskarlin mskarlin enabled auto-merge (squash) July 18, 2025 18:07
@mskarlin mskarlin disabled auto-merge July 18, 2025 18:28
@mskarlin mskarlin merged commit 6a5da1d into main Jul 18, 2025
7 of 10 checks passed
@mskarlin mskarlin deleted the variable-timeouts branch July 18, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants