Skip to content

Conversation

@sangyunpark99
Copy link
Collaborator

No description provided.

Cache miss가 발생하는 경우, DB에서 재고 데이터 동기화를 합니다.
@sangyunpark99 sangyunpark99 requested a review from f-lab-nolan May 1, 2025 06:40
if(!stockRedisRepository.isExisted(productId)) {
Long dbQuantity = stockJpaRepository.findQuantityByProductId(productId)
.orElseThrow(() -> new BusinessException(ErrorCode.PRODUCT_NOT_FOUND));
stockRedisRepository.setIfAbsentWithTTL(productId, dbQuantity, Duration.ofSeconds(30));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

나중에 admin( 판매자가 사용하는 화면에서 재고 관리할때 영향을 주지 않게 설계해야함)

@sangyunpark99 sangyunpark99 merged commit d39c32b into develop May 5, 2025
1 check passed
@sangyunpark99 sangyunpark99 changed the title Fix/11 product fix: 재고 차감 시나리오 예외 처리 May 5, 2025
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.

3 participants