mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-10 00:04:06 -09:00
support/scripts/pkg-stats: add a timeout on HTTP requests for upstream URLs
Some upstream sites are very slow to respond, and the default timeout
of 300 seconds of the aiohttp.ClientSession() is too long. Let's
reduce it to 15 seconds.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit 387c496b98)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
676d2e8d5b
commit
3030820835
@@ -440,7 +440,8 @@ async def check_url_status(session, pkg, npkgs, retry=True):
|
||||
async def check_package_urls(packages):
|
||||
tasks = []
|
||||
connector = aiohttp.TCPConnector(limit_per_host=5)
|
||||
async with aiohttp.ClientSession(connector=connector, trust_env=True) as sess:
|
||||
async with aiohttp.ClientSession(connector=connector, trust_env=True,
|
||||
timeout=aiohttp.ClientTimeout(total=15)) as sess:
|
||||
packages = [p for p in packages if p.status['url'][0] == 'ok']
|
||||
for pkg in packages:
|
||||
tasks.append(asyncio.ensure_future(check_url_status(sess, pkg, len(packages))))
|
||||
|
||||
Reference in New Issue
Block a user