Spaces:
Sleeping
Sleeping
Create ingest/health.py
Browse files- ingest/health.py +8 -15
ingest/health.py
CHANGED
|
@@ -1,17 +1,10 @@
|
|
| 1 |
-
import
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
"
|
| 9 |
-
"status": "healthy",
|
| 10 |
-
"latency_ms": latency_ms
|
| 11 |
}
|
| 12 |
-
|
| 13 |
-
return {
|
| 14 |
-
"source": adapter.source_name,
|
| 15 |
-
"status": "unhealthy",
|
| 16 |
-
"latency_ms": None
|
| 17 |
-
}
|
|
|
|
| 1 |
+
from .registry import get_all_adapters
|
| 2 |
|
| 3 |
+
def get_adapter_health():
|
| 4 |
+
health = {}
|
| 5 |
+
for adapter in get_all_adapters():
|
| 6 |
+
health[adapter.name] = {
|
| 7 |
+
"live": adapter.is_live,
|
| 8 |
+
"extended": adapter.is_extended,
|
|
|
|
|
|
|
| 9 |
}
|
| 10 |
+
return health
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|