Skip to content

Commit

Permalink
Added timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
madhavajay committed Jun 24, 2024
1 parent 82eda43 commit 1e1882e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/syft/src/syft/util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,12 +975,12 @@ def parse_iso8601_date(date_string: str) -> datetime:

def get_latest_tag(registry: str, repo: str) -> str | None:
repo_url = f"http://{registry}/v2/{repo}"
res = requests.get(url=f"{repo_url}/tags/list")
res = requests.get(url=f"{repo_url}/tags/list", timeout=5)
tags = res.json().get("tags", [])

tag_times = []
for tag in tags:
manifest_response = requests.get(f"{repo_url}/manifests/{tag}")
manifest_response = requests.get(f"{repo_url}/manifests/{tag}", timeout=5)
manifest = manifest_response.json()
created_time = json.loads(manifest["history"][0]["v1Compatibility"])["created"]
created_datetime = parse_iso8601_date(created_time)
Expand Down

0 comments on commit 1e1882e

Please sign in to comment.