From 12ed9bd3e92f650a6e30e41ffd8cc268376fbc4c Mon Sep 17 00:00:00 2001 From: Gamosoft Date: Tue, 30 Jun 2026 16:52:22 +0200 Subject: [PATCH] log fixes --- backend/main.py | 9 ++++----- plugins/note_stats.py | 1 - run.py | 4 ---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/backend/main.py b/backend/main.py index 230c629..a19e546 100644 --- a/backend/main.py +++ b/backend/main.py @@ -19,12 +19,12 @@ import aiofiles from datetime import datetime import bcrypt import secrets - -logger = logging.getLogger("uvicorn.error") from slowapi import Limiter, _rate_limit_exceeded_handler from slowapi.util import get_remote_address from slowapi.errors import RateLimitExceeded +logger = logging.getLogger("uvicorn.error") + from .utils import ( scan_notes_fast_walk, ensure_index_built, @@ -1829,9 +1829,8 @@ app.include_router(pages_router) # ============================================================================ # Startup warmup # ============================================================================ -# Pre-build the note index in a daemon thread so the first /api/notes request -# hits a warm index. Concurrent requests landing mid-warmup are safe: bulk_set -# is serialized by the index RLock and short-circuits via the fingerprint hash. +# Pre-build the note index off the request path. Mid-warmup requests are safe +# (bulk_set is serialized and short-circuits on the fingerprint). @app.on_event("startup") def _warmup_note_index() -> None: import threading diff --git a/plugins/note_stats.py b/plugins/note_stats.py index f72882a..d73ec86 100644 --- a/plugins/note_stats.py +++ b/plugins/note_stats.py @@ -12,7 +12,6 @@ import re logger = logging.getLogger("uvicorn.error") -# Average reading speed used to derive `reading_time_minutes`. WORDS_PER_MINUTE = 200 diff --git a/run.py b/run.py index 97f042c..bcac535 100644 --- a/run.py +++ b/run.py @@ -37,7 +37,6 @@ def get_port(): return "8000" def main(): - # Make sure runtime deps are present before invoking uvicorn. try: import fastapi # noqa: F401 import uvicorn # noqa: F401 @@ -50,9 +49,6 @@ def main(): port = get_port() - # Short pre-launch banner. Detailed startup logs come from uvicorn / - # backend.main below (INFO: / WARNING: / ERROR:), so the user can tell - # exactly when the server is actually accepting connections. print(f"🚀 NoteDiscovery → http://localhost:{port}") print(f" notes: ./data/ plugins: ./plugins/ stop: Ctrl+C") print()