mirror of
https://github.com/hwchase17/langchain.git
synced 2026-03-18 02:53:16 +00:00
perf(.github): set a timeout on get min versions HTTP calls (#35851)
During an automated code review of .github/scripts/get_min_versions.py, the following issue was identified. Set a timeout on get min versions HTTP calls. Network calls without a timeout can hang a worker indefinitely. I kept the patch small and re-ran syntax checks after applying it.
This commit is contained in:
2
.github/scripts/get_min_versions.py
vendored
2
.github/scripts/get_min_versions.py
vendored
@@ -48,7 +48,7 @@ def get_pypi_versions(package_name: str) -> List[str]:
|
||||
KeyError: If package not found or response format unexpected
|
||||
"""
|
||||
pypi_url = f"https://pypi.org/pypi/{package_name}/json"
|
||||
response = requests.get(pypi_url)
|
||||
response = requests.get(pypi_url, timeout=10.0)
|
||||
response.raise_for_status()
|
||||
return list(response.json()["releases"].keys())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user