-
Notifications
You must be signed in to change notification settings - Fork 3
[refactor] SSE 인원 입퇴장 이벤트 추가 및 SSE 사용 쿼리 분리 #181
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
Conversation
jiwon1217
left a comment
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.
고생하셨습니다 ㅎㅎ
sehee123
left a comment
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.
👍 x 100
| room.removePlayer(player); | ||
|
|
||
| Long quizId = room.getQuizId(); | ||
| Quiz quiz = quizService.getQuizWithQuestionsById(quizId); |
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.
[L5-참고의견]
RoomUpdatedEvent를 통해 SSE 이벤트를 발급할 때 Question의 사용은 quiz.getQuestions().size()으로 문제의 크기만 사용하는 것으로 보입니다.
하지만, getQuizWithQuestionsById는 해당 퀴즈의 모든 문제들을 Fetch Join 해오기 때문에 불필요한 오버헤드의 발생이 존재하는 것 같습니다.
추후 가능하다면 RoomUpdatedEvent 리팩토링을 통해 qustion size를 따로 받아오는 방향으로 개선해 보는 것도 좋다는 생각이 들었습니다.
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.
필요한 데이터만 가져오도록 쿼리를 findByQuizId와 getQuestionsCount쿼리로 분리해 변경하였습니다!
silver-eunjoo
left a comment
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.
고생하셨습니다 !!
- 퀴즈가 문제의 정보까지 fetch join하는 쿼리에서 findQuizById 쿼리로 문제는 Lazy 로딩하도록 변경
🛰️ Issue Number
#180
🪐 작업 내용
📚 Reference
✅ Check List