From: Michael Tremer Date: Thu, 19 Dec 2024 14:37:22 +0000 (+0000) Subject: mirrors: Use our default cURL-based HTTP client X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5e5996d65302f6d4bef04aa211533a929aee8a3;p=ipfire.org.git mirrors: Use our default cURL-based HTTP client Signed-off-by: Michael Tremer --- diff --git a/src/backend/mirrors.py b/src/backend/mirrors.py index 62f07765..b1d8a6a5 100644 --- a/src/backend/mirrors.py +++ b/src/backend/mirrors.py @@ -237,10 +237,8 @@ class Mirror(Object): self.set_state("UP") async def check_timestamp(self): - http = tornado.httpclient.AsyncHTTPClient() - try: - response = await http.fetch(self.url + ".timestamp", + response = await self.backend.http_client.fetch(self.url + ".timestamp", headers={ "Pragma" : "no-cache" }) except tornado.httpclient.HTTPError as e: logging.warning("Error getting timestamp from %s: %s" % (self.hostname, e)) @@ -289,10 +287,8 @@ class Mirror(Object): if not self.enabled: return - http = tornado.httpclient.AsyncHTTPClient() - try: - response = await http.fetch(self.url + ".filelist", + response = await self.backend.http_client.fetch(self.url + ".filelist", headers={ "Pragma" : "no-cache" }) except tornado.httpclient.HTTPError as e: logging.warning("Error getting filelist from %s: %s" % (self.hostname, e))