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