new changes in the api

This commit is contained in:
2026-07-06 15:15:51 +05:30
parent c742ef0e53
commit 871981035a
43 changed files with 414 additions and 1975 deletions

View File

@@ -83,19 +83,6 @@ async def lifespan(app: FastAPI):
except Exception as e:
logger.warning(f"[Analytics] DB check failed (non-fatal): {e}")
# Warm up the Thompson Sampling bandit (bootstraps from historical DB)
try:
from app.services.ml.strategy_bandit import get_bandit
bandit = get_bandit()
stats = bandit.get_stats()
logger.info(
f"[Bandit] RL strategy bandit ready — "
f"{stats['context_count']} contexts, "
f"{stats['total_updates']} historical updates loaded."
)
except Exception as e:
logger.warning(f"[Bandit] Warm-up failed (non-fatal): {e}")
# Start the autonomous empirical-ETA sync agent (daemon thread).
# It mirrors completed deliveries locally and rebuilds learned ETAs on a
# schedule, so the request path never touches Postgres.