Some checks failed
CI / test (pull_request) Has been cancelled
Add asyncio.Lock to prevent multiple coroutines from simultaneously refreshing the KIS access token, which hits the 1-per-minute rate limit (EGW00133: "접근토큰 발급 잠시 후 다시 시도하세요"). Changes: - Add self._token_lock in KISBroker.__init__ - Wrap token refresh in async with self._token_lock - Re-check token validity after acquiring lock (double-check pattern) - Add concurrent token refresh test (5 parallel requests → 1 API call) The lock ensures that when multiple coroutines detect an expired token, only the first one refreshes while others wait and reuse the result. Fixes: #42 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
9.8 KiB
9.8 KiB