Skip to content

Commit

Permalink
chore: 로그 확인을 위한 메시지 로그 업데이트 임시 로그 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
swonny committed Apr 18, 2024
1 parent 84a6a7f commit c6e8e91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.ddang.ddang.chat.domain;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.socket.WebSocketSession;

import java.util.Collections;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

@Slf4j
@Getter
public class WebSocketSessions {

Expand All @@ -24,6 +26,7 @@ public void putIfAbsent(final WebSocketSession session, final Long chatRoomId) {
}

public boolean contains(final Long userId) {
log.info("WebSocketSessions.contains userId : {}, currentSessions : {}", userId, sessions);
return sessions.stream()
.anyMatch(session -> session.getAttributes().get(USER_ID_KEY) == userId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private List<SendMessageDto> createSendMessages(
final Long chatRoomId
) throws JsonProcessingException {
final WebSocketSessions groupSessions = sessions.findSessionsByChatRoomId(message.getChatRoom().getId());
log.info("MessageTypeHandler.createSendMessages groupSessions : {}", groupSessions);

final List<SendMessageDto> sendMessageDtos = new ArrayList<>();
for (final WebSocketSession currentSession : groupSessions.getSessions()) {
Expand Down

0 comments on commit c6e8e91

Please sign in to comment.