mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
cleanup
This commit is contained in:
@@ -13,7 +13,6 @@ from reflector.logger import logger
|
|||||||
from reflector.metrics import metrics_init
|
from reflector.metrics import metrics_init
|
||||||
from reflector.settings import settings
|
from reflector.settings import settings
|
||||||
from reflector.views.daily import router as daily_router
|
from reflector.views.daily import router as daily_router
|
||||||
from reflector.views.hatchet import router as hatchet_router
|
|
||||||
from reflector.views.meetings import router as meetings_router
|
from reflector.views.meetings import router as meetings_router
|
||||||
from reflector.views.rooms import router as rooms_router
|
from reflector.views.rooms import router as rooms_router
|
||||||
from reflector.views.rtc_offer import router as rtc_offer_router
|
from reflector.views.rtc_offer import router as rtc_offer_router
|
||||||
@@ -99,7 +98,6 @@ app.include_router(user_ws_router, prefix="/v1")
|
|||||||
app.include_router(zulip_router, prefix="/v1")
|
app.include_router(zulip_router, prefix="/v1")
|
||||||
app.include_router(whereby_router, prefix="/v1")
|
app.include_router(whereby_router, prefix="/v1")
|
||||||
app.include_router(daily_router, prefix="/v1/daily")
|
app.include_router(daily_router, prefix="/v1/daily")
|
||||||
app.include_router(hatchet_router, prefix="/v1")
|
|
||||||
add_pagination(app)
|
add_pagination(app)
|
||||||
|
|
||||||
# prepare celery
|
# prepare celery
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
"""Hatchet health and status endpoints."""
|
|
||||||
|
|
||||||
from fastapi import APIRouter
|
|
||||||
|
|
||||||
from reflector.settings import settings
|
|
||||||
|
|
||||||
router = APIRouter(prefix="/hatchet", tags=["hatchet"])
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("/health")
|
|
||||||
async def hatchet_health():
|
|
||||||
"""Check Hatchet connectivity and status."""
|
|
||||||
if not settings.HATCHET_ENABLED:
|
|
||||||
return {"status": "disabled", "connected": False}
|
|
||||||
|
|
||||||
if not settings.HATCHET_CLIENT_TOKEN:
|
|
||||||
return {
|
|
||||||
"status": "unhealthy",
|
|
||||||
"connected": False,
|
|
||||||
"error": "HATCHET_CLIENT_TOKEN not configured",
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
|
||||||
from reflector.hatchet.client import HatchetClientManager
|
|
||||||
|
|
||||||
# Get client to verify token is valid
|
|
||||||
client = HatchetClientManager.get_client()
|
|
||||||
|
|
||||||
# Try to get the client's gRPC connection status
|
|
||||||
# The SDK doesn't have a simple health check, so we just verify we can create the client
|
|
||||||
if client is not None:
|
|
||||||
return {"status": "healthy", "connected": True}
|
|
||||||
else:
|
|
||||||
return {
|
|
||||||
"status": "unhealthy",
|
|
||||||
"connected": False,
|
|
||||||
"error": "Failed to create client",
|
|
||||||
}
|
|
||||||
except ValueError as e:
|
|
||||||
return {"status": "unhealthy", "connected": False, "error": str(e)}
|
|
||||||
except Exception as e:
|
|
||||||
return {"status": "unhealthy", "connected": False, "error": str(e)}
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("/workflow/{workflow_run_id}")
|
|
||||||
async def get_workflow_status(workflow_run_id: str):
|
|
||||||
"""Get the status of a workflow run."""
|
|
||||||
if not settings.HATCHET_ENABLED:
|
|
||||||
return {"error": "Hatchet is disabled"}
|
|
||||||
|
|
||||||
try:
|
|
||||||
from reflector.hatchet.client import HatchetClientManager
|
|
||||||
|
|
||||||
status = await HatchetClientManager.get_workflow_status(workflow_run_id)
|
|
||||||
return status
|
|
||||||
except Exception as e:
|
|
||||||
return {"error": str(e)}
|
|
||||||
Reference in New Issue
Block a user