refactoring-backend #3
@@ -32,9 +32,10 @@ from app.utils.runtime_state import (
|
||||
)
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from app.config import Settings
|
||||
from fastapi import FastAPI
|
||||
|
||||
from app.config import Settings
|
||||
|
||||
log: structlog.stdlib.BoundLogger = structlog.get_logger()
|
||||
|
||||
|
||||
@@ -53,7 +54,7 @@ HEALTH_CHECK_INTERVAL: int = 30
|
||||
_ACTIVATION_CRASH_WINDOW: int = 60
|
||||
|
||||
|
||||
async def _run_probe_with_resources(settings: "Settings", runtime_state: RuntimeState) -> None:
|
||||
async def _run_probe_with_resources(settings: Settings, runtime_state: RuntimeState) -> None:
|
||||
"""Probe fail2ban and cache the result on the runtime state.
|
||||
|
||||
Args:
|
||||
@@ -162,9 +163,7 @@ def register(app: FastAPI) -> None:
|
||||
id="health_check",
|
||||
replace_existing=True,
|
||||
# Fire immediately on startup too, so the UI isn't dark for 30 s.
|
||||
next_run_time=__import__("datetime").datetime.now(
|
||||
tz=__import__("datetime").timezone.utc
|
||||
),
|
||||
next_run_time=datetime.datetime.now(tz=datetime.UTC),
|
||||
)
|
||||
log.info(
|
||||
"health_check_scheduled",
|
||||
|
||||
Reference in New Issue
Block a user