fix: 대시보드 mode 배지 os.getenv 대신 settings.MODE 사용 (#237)
Some checks failed
CI / test (pull_request) Has been cancelled

os.getenv("MODE")는 .env 파일을 읽지 못해 항상 paper를 반환함.
create_dashboard_app에 mode 파라미터 추가 후 main.py에서
settings.MODE를 직접 전달하도록 수정.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
agentson
2026-02-24 06:52:10 +09:00
parent 271c592a46
commit 8c492eae3a
3 changed files with 25 additions and 15 deletions

View File

@@ -13,10 +13,11 @@ from fastapi import FastAPI, HTTPException, Query
from fastapi.responses import FileResponse
def create_dashboard_app(db_path: str) -> FastAPI:
def create_dashboard_app(db_path: str, mode: str = "paper") -> FastAPI:
"""Create dashboard FastAPI app bound to a SQLite database path."""
app = FastAPI(title="The Ouroboros Dashboard", version="1.0.0")
app.state.db_path = db_path
app.state.mode = mode
@app.get("/")
def index() -> FileResponse:
@@ -111,7 +112,7 @@ def create_dashboard_app(db_path: str) -> FastAPI:
return {
"date": today,
"mode": os.getenv("MODE", "paper"),
"mode": mode,
"markets": market_status,
"totals": {
"trade_count": total_trades,