21 lines
790 B
Python
21 lines
790 B
Python
import sys
|
|
import json
|
|
sys.path.insert(0, '/home/hoon/kis_bot')
|
|
from database import TradeDB
|
|
|
|
db = TradeDB()
|
|
try:
|
|
res = db.conn.execute("SELECT code, name, strategy, env_snapshot FROM active_trades WHERE env_snapshot IS NOT NULL ORDER BY updated_at DESC LIMIT 5").fetchall()
|
|
if not res:
|
|
print("현재 active_trades에 env_snapshot이 저장된 거래가 없습니다.")
|
|
else:
|
|
print(f"env_snapshot 저장 내역 {len(res)}건 확인:")
|
|
for r in res:
|
|
r_dict = dict(r)
|
|
snap = r_dict['env_snapshot']
|
|
snap_len = len(snap) if snap else 0
|
|
print(f"- {r_dict['name']}({r_dict['code']}) [{r_dict['strategy']}] | 스냅샷 길이: {snap_len} bytes")
|
|
except Exception as e:
|
|
print(f"조회 실패: {e}")
|
|
db.close()
|