mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-10 00:04:06 -09:00
support/scripts/pkg-stats: check_url_status(): use HEAD requests to limit server load
The gnu.org admins have been blocking the IP address of machines running
pkg-stats as the GET requests for the (many) packages with gnu.org URLs are
seen as abusive.
The resource body is not used, so use a HTTP HEAD request instead of a GET
to limit server load and bandwidth use.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit f9f3e6ccc6)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
committed by
Thomas Perale
parent
a6758069c2
commit
a2c5393f24
@@ -469,7 +469,7 @@ async def check_url_status(session, pkg, npkgs, retry=True, verbose=False):
|
||||
global check_url_count
|
||||
|
||||
try:
|
||||
async with session.get(pkg.url) as resp:
|
||||
async with session.head(pkg.url) as resp:
|
||||
if resp.status >= 400:
|
||||
pkg.status['url'] = ("error", "invalid {}".format(resp.status))
|
||||
check_url_count += 1
|
||||
|
||||
Reference in New Issue
Block a user