flip_api.trusts_services.trusts_health_check
Attributes
Functions
|
Retrieves health status of all trusts based on their last heartbeat timestamp. |
Module Contents
- flip_api.trusts_services.trusts_health_check.router
- async flip_api.trusts_services.trusts_health_check.check_trusts_health(db: sqlmodel.Session = Depends(get_session)) list[flip_api.domain.interfaces.trust.ITrustHealth]
Retrieves health status of all trusts based on their last heartbeat timestamp.
Instead of making outbound HTTP calls to each trust’s /health endpoint, this checks the last_heartbeat field updated by the trust’s polling service.
- Parameters:
db (Session) – Database session for querying trusts.
- Returns:
A list of ITrustHealth objects representing the health status of each trust.
- Return type:
list[ITrustHealth]
- Raises:
HTTPException – If no trusts are found in the database or if there is an error during the operation.