From 981eef5b62833cae66062672bcbcc55784d2cf44 Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Sun, 26 Nov 2023 15:22:56 +0100 Subject: [PATCH] [haproxy] Make HTTP requests in parallel (#192) It cuts the script execution time roughly by three during my tests. --- src/haproxy.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/haproxy.py b/src/haproxy.py index 701db0fc..b08a73e1 100644 --- a/src/haproxy.py +++ b/src/haproxy.py @@ -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()