Skip to content

Commit d09e59a

Browse files
committed
chore(backend): remove recost telemetry middleware
The recost API key is revoked, so the middleware was logging an HTTP 401 on every request and adding latency for no benefit. Drop the import, the env-var branch, and the requirements entry. Re-add cleanly later if we get a working recost project + key.
1 parent 3db5619 commit d09e59a

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

backend/main.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
from pathlib import Path
32

43
from dotenv import load_dotenv
@@ -11,25 +10,10 @@
1110
from routes.admin import router as admin_router
1211
from routes.newsletter import router as newsletter_router
1312

14-
try:
15-
from recost.frameworks.fastapi import RecostMiddleware
16-
except ImportError:
17-
RecostMiddleware = None # optional; tests/CI without recost package
18-
1913
load_dotenv(Path(__file__).with_name(".env"))
2014

21-
RECOST_PROJECT_ID = "eaf22d10-840d-494f-8513-2dcef769ace1"
22-
recost_api_key = os.getenv("RECOST_API_KEY")
23-
2415
app = FastAPI(title="Sapling API", version="1.0.0")
2516

26-
if recost_api_key and RecostMiddleware is not None:
27-
app.add_middleware(
28-
RecostMiddleware,
29-
api_key=recost_api_key,
30-
project_id=RECOST_PROJECT_ID,
31-
)
32-
3317
app.add_middleware(
3418
CORSMiddleware,
3519
allow_origins=[FRONTEND_URL, "http://localhost:3000"],

backend/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ httpx
1414
cryptography>=42,<46
1515
mammoth
1616
python-pptx
17-
recost
1817

1918
# OCR pipeline (Docling = default, GOT-OCR 2.0 = optional GPU fallback)
2019
docling>=2.15,<3

0 commit comments

Comments
 (0)