Skip to content

Commit

Permalink
Feat: 사용자가 접속되지 않은 서버이면 broadcast 스킵
Browse files Browse the repository at this point in the history
  • Loading branch information
jzakka committed Feb 20, 2024
1 parent 03c294d commit 2f274c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/stoury/config/sse/SseEmitters.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ private SseEmitter chatRoomEmitter(Long roomId) {
public void broadcast(Long roomId, ChatMessageResponse chatMessage) {
Long roomIdNotNull = Objects.requireNonNull(roomId, ROOM_ID_NULL_MESSAGE);

SseEmitter emitter = get(roomIdNotNull);
SseEmitter emitter = chatRoomEmitters.get(roomIdNotNull);
if (emitter == null) {
return;
}

for (int i = 1; i <= MAX_RETRY; i++) {
try {
Expand Down

0 comments on commit 2f274c2

Please sign in to comment.