Health
rn_forge.fastapi.health
Build liveness and readiness routes.
health_router(*, checks, required=(), prefix='', timeout=None, liveness_path=LIVENESS_PATH, readiness_path=READINESS_PATH, legacy_liveness_path=LEGACY_LIVENESS_PATH)
Return a router serving the liveness and readiness paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checks
|
Mapping[str, Check]
|
Name → check, sync or async, returning a
:class: |
required |
required
|
Collection[str]
|
The names whose failure makes the service unavailable (503). |
()
|
prefix
|
str
|
Mounted in front of every path. |
''
|
timeout
|
float | None
|
Seconds each check may run before it is reported as |
None
|
liveness_path
|
str
|
The liveness path. |
LIVENESS_PATH
|
readiness_path
|
str
|
The readiness path. |
READINESS_PATH
|
legacy_liveness_path
|
str | None
|
An alias of liveness_path, marked deprecated
in the OpenAPI document. |
LEGACY_LIVENESS_PATH
|