[haproxy] Make HTTP requests in parallel (#192)

It cuts the script execution time roughly by three during my tests.
This commit is contained in:
Marc Wrobel
2023-11-26 15:22:56 +01:00
committed by GitHub
parent b9e27ab45a
commit 981eef5b62

View File

@@ -31,10 +31,9 @@ def fetch_cycles():
def fetch_releases(cycles):
releases = {}
for cycle in cycles:
url = f"https://www.haproxy.org/download/{cycle}/src/CHANGELOG"
response = endoflife.fetch_url(url)
for line in response.split('\n'):
urls = [f"https://www.haproxy.org/download/{cycle}/src/CHANGELOG" for cycle in cycles]
for response in endoflife.fetch_urls(urls):
for line in response.text.split('\n'):
m = re.match(VERSION_REGEX, line)
if m:
year, month, day, version = m.groups()