자동매매 응답 로그 출력 추가

This commit is contained in:
2026-01-27 03:12:50 +09:00
parent a330a5271c
commit 55863d7744

View File

@@ -1,4 +1,5 @@
import os
import json
from fastapi import FastAPI
from fastapi.responses import JSONResponse
from fastapi.middleware.cors import CORSMiddleware
@@ -6,6 +7,8 @@ import requests
from apscheduler.schedulers.background import BackgroundScheduler
from pydantic import BaseModel
from .db import init_db, save_articles, get_latest_articles
from .scraper import fetch_market_news, fetch_major_indices, fetch_overseas_news
@@ -131,8 +134,9 @@ def auto_trade():
print(f"[ProxyError] Auto Trade Error: {resp.status_code} {resp.text}")
return JSONResponse(status_code=resp.status_code, content=resp.json())
print("[Proxy] Auto Trade Success")
return resp.json()
result = resp.json()
print(f"[Proxy] Auto Trade Success. Response:\n{json.dumps(result, indent=2, ensure_ascii=False)}")
return result
except Exception as e:
print(f"[ProxyError] Auto Trade Connection Failed: {e}")
return JSONResponse(