Files
stt-module/healthcheck.py
Billy D. 55cd657364
Some checks failed
CI / Docker Build & Push (push) Has been skipped
CI / Notify (push) Successful in 1s
CI / Lint (push) Failing after 9s
CI / Test (push) Successful in 50s
CI / Release (push) Has been skipped
feat: CI pipeline, lint fixes, and Renovate config
- pyproject.toml with ruff/pytest config (setuptools<81 pin)
- Full test suite (26 tests)
- Gitea Actions CI (lint, test, docker, notify)
- Ruff lint/format fixes across source files
- Renovate config for automated dependency updates

Ref: ADR-0057
2026-02-13 15:33:35 -05:00

30 lines
647 B
Python

#!/usr/bin/env python3
"""
Health check script for Kubernetes probes
Verifies NATS connectivity
"""
import asyncio
import os
import sys
import nats
NATS_URL = os.environ.get("NATS_URL", "nats://nats.ai-ml.svc.cluster.local:4222")
async def check_health():
"""Check if service can connect to NATS."""
try:
nc = await asyncio.wait_for(nats.connect(NATS_URL), timeout=5.0)
await nc.close()
return True
except Exception as e:
print(f"Health check failed: {e}", file=sys.stderr)
return False
if __name__ == "__main__":
result = asyncio.run(check_health())
sys.exit(0 if result else 1)