Catalyst / admin/Syanpse-Vanguard 14.8 GB / 57.8 GB 40.0 GB free
Help Sign in

admin / Syanpse-Vanguard

public
Code Issues Pull requests Pipelines Packages Security Insights Wiki Settings
Syanpse-Vanguard / synapse-vanguard-v3 / sv / healthcheck.py 747 B · main
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Container healthcheck entrypoint (`python -m sv.healthcheck`). Verifies the
process can import the app and reach its storage/broker config without error."""
from __future__ import annotations

import sys

from sv.config import settings


def main() -> int:
    # Minimal, dependency-light liveness signal for Docker. Deeper readiness
    # (broker reachable, schema present) is exposed via each service's /healthz.
    try:
        assert settings.storage_backend in {"duckdb", "clickhouse"}
        assert settings.broker in {"redis", "memory"}
        return 0
    except Exception as exc:  # noqa: BLE001
        print(f"healthcheck failed: {exc}", file=sys.stderr)
        return 1


if __name__ == "__main__":
    raise SystemExit(main())