INNER CODE UNIT · Python
_startup_warmup
ohdearquant/lionagi · lionagi/studio/app.py:171
async def _startup_warmup() -> None:
"""Deferred WAL checkpoint, off the critical path so /health serves as
soon as reconciliation completes."""
try:
from .services.db_maintenance import checkpoint_state_db
await checkpoint_state_db(actor="startup")
except Exception: # noqa: BLE001
_log.warning("Startup WAL checkpoint failed (non-fatal)", exc_info=True)
async def _finalize_warmup(task: asyncio.Task | None) -> None:
"""Cancel the warmup task if still running, then await it (avoids an
un-retrieved-task warning)."""
if task is None:
return
if not task.done():
task.cancel()