From 0531952edbcce91b377b4b8a58d5d7f102c57134 Mon Sep 17 00:00:00 2001 From: YoungWooSeo Date: Tue, 3 Mar 2026 10:44:49 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20lifespan=EC=97=90=20strategy=5Fcfg.auto?= =?UTF-8?q?=5Finit()=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/app/main.py b/backend/app/main.py index c7a85b6..0d5d493 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -354,6 +354,14 @@ async def lifespan(app: FastAPI): except Exception as e: logger.warning(f"⚠️ loss_tracker 초기화 실패 (non-critical): {e}") + # ── 전략 파라미터 DB 초기화 (config.py 기본값 → strategy_configs 테이블 seed) ── + try: + from app.services.strategy_config_service import strategy_cfg + await strategy_cfg.auto_init() + except Exception as e: + logger.warning(f"⚠️ strategy_cfg 초기화 실패 (non-critical): {e}") + # ──────────────────────────────────────────────────────────────────────────── + try: from app.models.models import StockAnalysis, TradeHistory, Portfolio from sqlalchemy import delete