From 2eb22ec15fe9a4de2185c663929d7da9cc387110 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 27 Apr 2023 10:23:57 +0000 Subject: [PATCH] hub: Attempt to reconnect on 502 Proxy Error Signed-off-by: Michael Tremer --- src/pakfire/hub.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pakfire/hub.py b/src/pakfire/hub.py index 3e95b8647..a3b3c7517 100644 --- a/src/pakfire/hub.py +++ b/src/pakfire/hub.py @@ -466,8 +466,9 @@ class HubObject(object): except tornado.httpclient.HTTPClientError as e: log.error("%s: Received HTTP Error %s" % (self.url, e.code)) - # If the service is down we will retry in 10 seconds - if e.code == 503: + # 502 - Proxy Error + # 503 - Service Unavailable + if e.code in (502, 503): await asyncio.sleep(10) # Raise any unhandled errors -- 2.39.5