Spaces:
Runtime error
Runtime error
Update status_check.py
Browse files- status_check.py +14 -12
status_check.py
CHANGED
@@ -101,18 +101,20 @@ def run_status_checks():
|
|
101 |
|
102 |
# Wake it up before health check
|
103 |
wake_up_successful = wake_up_endpoint(endpoint_uri, ui)
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
107 |
else:
|
108 |
ui.append("✅ End point responded OK.")
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
101 |
|
102 |
# Wake it up before health check
|
103 |
wake_up_successful = wake_up_endpoint(endpoint_uri, ui)
|
104 |
+
success, error_msg = wake_up_endpoint(endpoint_uri, ui)
|
105 |
+
i
|
106 |
+
if not success:
|
107 |
+
ui.append("Warning: Could not wake up the endpoint. Exiting.")
|
108 |
+
|
109 |
else:
|
110 |
ui.append("✅ End point responded OK.")
|
111 |
|
112 |
+
is_healthy, status_info = check_model_endpoint(endpoint_uri) # Test the endpoint
|
113 |
+
|
114 |
+
if not is_healthy:
|
115 |
+
from checks.failed_check import create_failed_gradio_ui
|
116 |
+
interface = create_failed_gradio_ui(status_info)
|
117 |
+
interface.launch(show_error=True, share=True)
|
118 |
+
return None
|
119 |
+
|
120 |
+
return endpoint_uri
|