기록하며 성장한다 - 개발, 회고

Redis 4

[ 개발 회고록 ] Redis INCR 를 활용하여 선착순 쿠폰 발급 기능 만들기

쿠폰은 100개인데, 왜 104명한테 발급이 됐지...??? 서론 현재 배달과 관련 된 토이프로젝트를 진행하고 있다. 토이 프로젝트 링크 capacity.getDescription() ) { throw new ApiException(COUPON_END); } try { Coupon coupon = Coupon.builder() .memberId(memberId) .couponType(couponType) .status(Status.DEFAULT) .expireDateTime(LocalDateTime.now().plusYears(1)) // 쿠폰은 발급 후 1년 안에 사용해야 하는 정책이 있는 거로 설계. .build(); couponRepository.save(coupon); } @Repository @..

개발 회고록 2024.01.23