From d03012bb04a12219ac895c0b8a238b773890d0fc Mon Sep 17 00:00:00 2001 From: 21in7 Date: Mon, 9 Mar 2026 22:52:21 +0900 Subject: [PATCH] fix(dashboard): detect symbols from any bot_status key, not just last_start The /api/symbols endpoint only returned symbols that had a :last_start key, which requires the log parser to catch the bot start log. If the dashboard was deployed after the bot started, the start log was already past the file position and symbols showed as 0. Now extracts symbols from any colon-prefixed key in bot_status. Co-Authored-By: Claude Opus 4.6 --- dashboard/api/dashboard_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/api/dashboard_api.py b/dashboard/api/dashboard_api.py index 40723be..752c5f2 100644 --- a/dashboard/api/dashboard_api.py +++ b/dashboard/api/dashboard_api.py @@ -37,9 +37,9 @@ def get_symbols(): """활성 심볼 목록 반환.""" with get_db() as db: rows = db.execute( - "SELECT key FROM bot_status WHERE key LIKE '%:last_start'" + "SELECT DISTINCT key FROM bot_status WHERE key LIKE '%:%'" ).fetchall() - symbols = [r["key"].split(":")[0] for r in rows] + symbols = {r["key"].split(":")[0] for r in rows} return {"symbols": sorted(symbols)}