]> git.ipfire.org Git - ipfire.org.git/commitdiff
mirrors: Use our default cURL-based HTTP client
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Dec 2024 14:37:22 +0000 (14:37 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Dec 2024 14:37:22 +0000 (14:37 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/mirrors.py

index 62f077656d550f6b49d6558e45bdfd5c4f6461b2..b1d8a6a59ef52b240310cc117fbc3e0ebabbcf6a 100644 (file)
@@ -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))