INNER CODE UNIT · Python

lifespan

shenmintao/marginalia · src/marginalia/main.py:50

async def lifespan(app: FastAPI):
    settings = get_settings()
    state_written = False
    runner: TaskRunner | None = None
    log.info(
        "backend startup: home=%s storage_backend=%s worker_enabled=%s desktop=%s",
        settings.marginalia_home,
        settings.storage_backend,
        settings.worker_enabled,
        os.environ.get("MARGINALIA_DESKTOP") == "1",
    )
    _warn_if_unauthenticated_bind(settings)
    # Desktop launch: server must come up even when the user hasn't entered
    # an API key yet, so they can do it from the Settings page. Tasks that
    # actually need an LLM call still fail at call time. Headless / CLI
    # launches keep the historical hard-fail.
    try:
        if os.environ.get("MARGINALIA_DESKTOP") == "1":

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…