Skip to content

Commit 9bca93d

Browse files
authored
Merge pull request #1188 from woowacourse-teams/BE/test
[BE] 토스트 알림 여러번 발생하는 문제 해결 운영 서버로 이동
2 parents 7374b99 + 03b3179 commit 9bca93d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

backend/src/main/java/site/coduo/websocket/WebSocketHandler.java

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public class WebSocketHandler extends TextWebSocketHandler {
2222
public void afterConnectionEstablished(final WebSocketSession session) {
2323
final String pairRoomAccessCode = parsePairRoomAccessCode(session);
2424
pairRoomWebSocketSessionStore.addSession(pairRoomAccessCode, session);
25-
schedulerService.notifyTimerStatus(pairRoomAccessCode);
2625
log.info("연결 성공 : {}", session.getId());
2726
}
2827

backend/src/main/java/site/coduo/websocket/stomp/StompEventListener.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public void onSubscription(final SessionSubscribeEvent event) {
3030
throw new NotFoundAccessCodeInQueryException("STOMP 헤더에 simpDestination이 존재하지 않습니다.");
3131
}
3232
final String key = parsePairRoomKey(destination);
33-
schedulerService.notifyTimerStatus(key);
33+
if (timerStompManager.isTimerStatusDestination(key, destination)) {
34+
schedulerService.notifyTimerStatus(key);
35+
}
3436
}
3537

3638
@EventListener
@@ -41,7 +43,9 @@ public void onUnSubscription(final SessionUnsubscribeEvent event) {
4143
throw new NotFoundAccessCodeInQueryException("STOMP 헤더에 simpSubscriptionId가 존재하지 않습니다.");
4244
}
4345
final String key = parsePairRoomKey(destination);
44-
schedulerService.syncTimerWithDatabase(key);
46+
if (timerStompManager.isTimerStatusDestination(key, destination)) {
47+
schedulerService.syncTimerWithDatabase(key);
48+
}
4549
}
4650

4751
private String parsePairRoomKey(final String destination) {

0 commit comments

Comments
 (0)