From 167190b30ed312e4b92bbae7521111b7c0fe16d6 Mon Sep 17 00:00:00 2001 From: jongjae Date: Mon, 18 May 2026 08:35:23 +0900 Subject: [PATCH] =?UTF-8?q?[2026-05-18]=20=EC=8A=A4=EC=BC=80=EC=A4=84?= =?UTF-8?q?=EB=9F=AC=20=EB=A3=A8=ED=94=84=20=EC=98=88=EC=99=B8=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80=20=E2=80=94=20Discord=20?= =?UTF-8?q?=EC=8B=A4=ED=8C=A8=20=EC=8B=9C=20=EB=B4=87=20=EC=A2=85=EB=A3=8C?= =?UTF-8?q?=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/app/main.py b/app/main.py index 80b3b26..c9b39c7 100644 --- a/app/main.py +++ b/app/main.py @@ -437,31 +437,35 @@ async def run(): while True: now = datetime.now().strftime("%H:%M") - # 08:30 AI 컨텍스트 로드 + 유니버스 갱신 - # (claude_morning이 08:15에 시작해 08:30 전에 daily_context.json 생성) - if now == "08:30": - ctx = bot.strategy.load_ai_context() - await notify_ai_result( - ctx["market_sentiment"], - ctx["sentiment_score"], - ctx.get("hot_sectors", []), - ctx.get("avoid_sectors", []), - ctx.get("reason", ""), - ) - bot.risk.set_risk_level(ctx.get("risk_level", "보통")) - await bot.update_universe() + try: + # 08:30 AI 컨텍스트 로드 + 유니버스 갱신 + # (claude_morning이 08:15에 시작해 08:30 전에 daily_context.json 생성) + if now == "08:30": + ctx = bot.strategy.load_ai_context() + await notify_ai_result( + ctx["market_sentiment"], + ctx["sentiment_score"], + ctx.get("hot_sectors", []), + ctx.get("avoid_sectors", []), + ctx.get("reason", ""), + ) + bot.risk.set_risk_level(ctx.get("risk_level", "보통")) + await bot.update_universe() - # 08:50 목표가 계산 - elif now == "08:50": - await bot.calc_targets() + # 08:50 목표가 계산 + elif now == "08:50": + await bot.calc_targets() - # 09:00 매매 루프 시작 - elif now == "09:00": - await bot.trading_loop() + # 09:00 매매 루프 시작 + elif now == "09:00": + await bot.trading_loop() - # 15:10 결산 - elif now == "15:10": - await bot.daily_summary() + # 15:10 결산 + elif now == "15:10": + await bot.daily_summary() + + except Exception as e: + logger.error(f"스케줄러 루프 오류 ({now}): {e}", exc_info=True) await asyncio.sleep(30)