-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: TickerService 예매, 테스트 코드 추가 #11
feat: TickerService 예매, 테스트 코드 추가 #11
Conversation
throw new TicketsNotAvailableException(); | ||
} | ||
|
||
Duration expirationTime = Duration.ofMinutes(5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic number는 상수처리하시면 좋습니다
|
||
@Override | ||
@Transactional | ||
public void reserveTickets(TicketDTO ticketDTO) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
동시성 문제를 발생 시킨 후에 문제 해결을 하여 왜 문제가 발생하였고 어떻게 해결 됐는지를 문서화 해두면 좋습니다
@Override | ||
@Transactional | ||
public void reserveTickets(TicketDTO ticketDTO) { | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ticket 검증로직과 reserve로직을 다른 메서드로 분리하면 어떤 장점이 있을지 고려해보면 좋습니다
|
||
spring.datasource.url=jdbc:mysql://localhost:3306/safeticket_db | ||
spring.datasource.username=root | ||
spring.datasource.password=password |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용자 정보와 같이 보안상 예민한 정보를 노출하지 않는 방법을 고려해보시기 바랍니다
📌 변경 사항
🤔 고민한 점
FOR UPDATE NOWAIT
을 추가하여 대기하지 않고 바로 예외처리 발생시키도록 하였습니다.😅 실수한 부분