From 8dbc9d9ceea2d8520306d5837abaf8cd55e6430c Mon Sep 17 00:00:00 2001 From: Bishoy Hany <167128903+Bishoy-at-pieces@users.noreply.github.com> Date: Mon, 2 Sep 2024 02:25:28 +0300 Subject: [PATCH 1/2] fix compatibility issue --- src/pieces/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pieces/settings.py b/src/pieces/settings.py index 53384f90..b36a166b 100644 --- a/src/pieces/settings.py +++ b/src/pieces/settings.py @@ -223,7 +223,7 @@ def get_health(cls): bool: True if the health status is 'ok', False otherwise. """ try: - health = WellKnownApi(cls.api_client).get_well_known_health() - return health == "ok" - except Exception as e: - return False + return self.well_known_api.get_well_known_health_with_http_info().status_code == 200 + except: + pass + return False From c4ffa3b414cc100055d3428b65312cfe4943d7f6 Mon Sep 17 00:00:00 2001 From: Bishoy-at-pieces Date: Mon, 2 Sep 2024 02:30:10 +0300 Subject: [PATCH 2/2] fix indent error --- src/pieces/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pieces/settings.py b/src/pieces/settings.py index b36a166b..4311a302 100644 --- a/src/pieces/settings.py +++ b/src/pieces/settings.py @@ -223,7 +223,7 @@ def get_health(cls): bool: True if the health status is 'ok', False otherwise. """ try: - return self.well_known_api.get_well_known_health_with_http_info().status_code == 200 - except: - pass - return False + return WellKnownApi(cls.api_client).get_well_known_health_with_http_info().status_code == 200 + except: + pass + return False