Skip to content

Commit

Permalink
api: added session timeout to fetch zipball.
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromumo authored and slint committed Jan 11, 2024
1 parent f3464f2 commit 81bdb93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion invenio_github/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ def retrieve_remote_file(self, file_name):
def fetch_zipball_file(self):
"""Fetch release zipball file using the current github session."""
session = self.gh.api.session
with session.get(self.release_zipball_url, stream=True) as s:
timeout = current_app.config.get("GITHUB_ZIPBALL_TIMEOUT", 300)
with session.get(self.release_zipball_url, stream=True, timeout=timeout) as s:
yield s.raw

def publish(self):
Expand Down
3 changes: 3 additions & 0 deletions invenio_github/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@

GITHUB_CITATION_METADATA_SCHEMA = None
"""Citation metadata schema."""

GITHUB_ZIPBALL_TIMEOUT = 300
"""Timeout for the zipball download, in seconds."""

0 comments on commit 81bdb93

Please sign in to comment.