Fix HiFi client not failing over to next instance on HTTP 500

Previously only 502/503/504 triggered instance rotation. A 500 from one
instance (e.g. triton.squid.wtf choking on a specific query) would stop
the search entirely instead of trying the next instance.
pull/253/head
Broque Thomas 2 months ago
parent e02ad6e86e
commit c3546ac0bd

@ -191,7 +191,7 @@ class HiFiClient:
self._rotate_instance(instance)
except http_requests.exceptions.HTTPError as e:
status = e.response.status_code if e.response is not None else 0
if status in (502, 503, 504):
if status >= 500:
logger.warning(f"HiFi API server error ({status}): {instance}")
self._rotate_instance(instance)
else:

Loading…
Cancel
Save