[2026-05-22] 일일 리포트 — 14건 승7패7 -127,406원 / TimeoutError 로그 버그 수정

- reports/daily/2026-05-22.md 생성
- main.py: except 블록에 type(e).__name__ 추가 (빈 에러 메시지 방지)
- kis_client._request: asyncio.TimeoutError 명시적 catch → RuntimeError re-raise
This commit is contained in:
2026-05-22 15:34:28 +09:00
parent 2aeb024c4c
commit 4b18db1152
3 changed files with 71 additions and 9 deletions
+10 -7
View File
@@ -182,13 +182,16 @@ class KISClient:
self._req_times.append(time.monotonic())
_timeout = aiohttp.ClientTimeout(total=10)
async with aiohttp.ClientSession(timeout=_timeout) as session:
if method == "GET":
async with session.get(url, headers=headers, params=params) as r:
data = await r.json()
else:
async with session.post(url, headers=headers, json=body) as r:
data = await r.json()
try:
async with aiohttp.ClientSession(timeout=_timeout) as session:
if method == "GET":
async with session.get(url, headers=headers, params=params) as r:
data = await r.json()
else:
async with session.post(url, headers=headers, json=body) as r:
data = await r.json()
except asyncio.TimeoutError:
raise RuntimeError(f"KIS API 타임아웃 [{tr_id}]")
# 응답 코드 체크
rt_cd = data.get("rt_cd", "")