[23기_황신애] 성능최적화 미션 제출합니다.#73
Open
shinae1023 wants to merge 10 commits into
Open
Conversation
- 로그인 API 추가 - 회원가입 API 추가 - 사용자 엔티티 및 Repository 추가 - Spring Security 및 JWT 인증 설정 추가 - 아이디/이메일 중복 검증 추가 - Swagger 문서 설정 추가
whc9999
reviewed
May 26, 2026
Comment on lines
+113
to
+127
| try { | ||
| response = paymentService.cancelPayment(reservation.getPaymentId()); | ||
| } catch (GeneralException e) { | ||
| reservationService.markPaymentUnknown(userId, reservationId); | ||
| throw e; | ||
| } | ||
|
|
||
| if (response == null | ||
| || response.data() == null | ||
| || PaymentStatus.from(response.data().paymentStatus()) != PaymentStatus.CANCELLED) { | ||
| reservationService.markPaymentUnknown(userId, reservationId); | ||
| throw new GeneralException(GeneralErrorCode.PAYMENT_NOT_CANCELLABLE); | ||
| } | ||
|
|
||
| reservationService.cancelPaidReservationAfterPaymentCancellation(userId, reservationId); |
There was a problem hiding this comment.
PG 취소 실패 또는 비정상 응답 시 reservationService.markPaymentUnknown()을 호출하는데요, 그런데 Reservation.markPaymentUnknown()은 현재 PROCESSING + 대기 상태에서만 허용하도록 바뀌었네요. 완료 예매 취소 케이스는 보통 PAID + 완료라서, PG 취소 실패를 UNKNOWN으로 남기려는 순간 PAYMENT_NOT_READY가 다시 터질 수 있을 것 같습니다...
취소 실패용 상태 전이는 PAID/완료 -> UNKNOWN을 허용하거나, “결제 승인 실패 UNKNOWN”과 “결제 취소 실패 UNKNOWN”을 별도 메서드/상태로 분리하는게 어떨까요??
Comment on lines
+121
to
+126
| || response.data() == null | ||
| || PaymentStatus.from(response.data().paymentStatus()) != PaymentStatus.CANCELLED) { | ||
| reservationService.markPaymentUnknown(userId, reservationId); | ||
| throw new GeneralException(GeneralErrorCode.PAYMENT_NOT_CANCELLABLE); | ||
| } | ||
|
|
There was a problem hiding this comment.
외부 시스템 응답 파싱은 실패 가능성이 있으니, 파싱 예외까지 잡아서 UNKNOWN 처리 후 도메인 예외로 변환하는 흐름이 어떨까용?
Comment on lines
15
to
18
| public void expirePendingReservationsAndFoodOrders() { | ||
| expirePendingReservations(); | ||
| expirePendingFoodOrders(); | ||
| } |
There was a problem hiding this comment.
오호 만료 배치를 서비스로 분리 했군요. 근데 예매 만료에서 예외가 나면 매점 주문 만료는 실행되지 않을 것 같아요. 각 호출을 try/catch로 감싸서 실패 로그를 남기고 다음 작업은 계속 수행하거나, 스케줄러 자체를 분리하는게 어떨까요??
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.