Skip to content

Feature/st 01#24

Closed
hyhdb wants to merge 2 commits into
devfrom
feature/st-01
Closed

Feature/st 01#24
hyhdb wants to merge 2 commits into
devfrom
feature/st-01

Conversation

@hyhdb
Copy link
Copy Markdown
Collaborator

@hyhdb hyhdb commented Apr 17, 2026

📌 변경 사항

  • 종목 가격 조회 시 종가(closePrice) fallback 로직 추가
  • StockPriceCache에 closePrice 필드 추가
  • 장 종료 후 currentPrice가 0으로 내려오는 문제 해결
  • stock 캐시 구조 개선

🔧 상세 내용

기존에는 한투 API에서 현재가(currentPrice)를 그대로 사용했는데,
장이 종료된 경우 currentPrice가 0으로 내려오는 문제가 있었습니다.

이를 해결하기 위해 다음과 같이 수정했습니다.

  • currentPrice가 0일 경우
    → 주식현재가 일자별 API를 호출하여 종가(stck_clpr)를 가져오도록 처리
  • closePrice를 캐시에 함께 저장하여 재사용 가능하도록 구조 개선

⚠️ 고려 사항

  • 종가 API는 currentPrice가 0일 때만 호출하도록 하여
    API 호출 제한(초당 요청 수 제한)을 고려했습니다.
  • 향후 Redis 또는 Spring Cache 적용을 통해 캐시 구조 개선 필요

🧪 테스트

  • 장중: 기존 currentPrice 정상 출력 확인
  • 장 종료 상황은 fallback 로직 기반으로 대응 (실제 장 종료 후 추가 검증 예정)

@hyhdb hyhdb closed this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant