Skip to content

Commit

Permalink
Fix celery gets stuck (#220)
Browse files Browse the repository at this point in the history
* Add timeout to fetching archive or else it hangs indefinitely

* Add timeout to fetching swm or else it hangs indefinitely
  • Loading branch information
omar-selo authored Oct 10, 2024
1 parent 8f49818 commit 7402e4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/test_observer/external_apis/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _create_download_and_extract_filepaths(self) -> None:

def _download_data(self) -> None:
"""Download Packages.gz file from archive"""
response = requests.get(self.url, stream=True)
response = requests.get(self.url, stream=True, timeout=30)
if not response.ok:
response.raise_for_status()

Expand Down
2 changes: 1 addition & 1 deletion backend/test_observer/kernel_swm_integration/swm_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_artefacts_swm_info(db: Session) -> dict[int, ArtefactTrackerInfo]:

def _fetch_stable_workflow_manager_status() -> dict:
url = "https://kernel.ubuntu.com/swm/status.json"
return requests.get(url).json()
return requests.get(url, timeout=30).json()


def _extract_artefact_bug_info_from_swm(
Expand Down

0 comments on commit 7402e4e

Please sign in to comment.