hack-house/.venv/lib/python3.12/site-packages/sanic_ext/extensions/health/extension.py
leetcrypt bb1d662ee1 chore: rename project coven → hack-house ⛧
Rebrand the Rust client crate (coven/ → hh/, package+binary "hack-house"),
README, CLI strings, and branch (coven → hack-house). Gitea repo renamed
cmd-chat → hack-house to match. Crypto/server logic unchanged; selftest +
golden-vector test still green, binary is now `hack-house`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 13:29:14 -07:00

31 lines
1.0 KiB
Python

from sanic.exceptions import SanicException
from sanic_ext.extensions.health.endpoint import setup_health_endpoint
from ..base import Extension
from .monitor import HealthMonitor
class HealthExtension(Extension):
name = "health"
MIN_VERSION = (22, 9)
def startup(self, bootstrap) -> None:
if self.config.HEALTH:
if self.config.HEALTH_MONITOR:
if self.MIN_VERSION > bootstrap.sanic_version:
min_version = ".".join(map(str, self.MIN_VERSION))
sanic_version = ".".join(map(str, bootstrap.sanic_version))
raise SanicException(
f"Health monitoring only works with Sanic "
f"v{min_version} and above. It looks like you are "
f"running {sanic_version}."
)
HealthMonitor.setup(self.app)
if self.config.HEALTH_ENDPOINT:
setup_health_endpoint(self.app)
def included(self):
return self.config.HEALTH