Skip to content

Commit 03b3179

Browse files
authored
Merge pull request #1187 from woowacourse-teams/BE/dev
[BE] 타이머 상태 모든 구독자들에게 전송하도록 롤백 테스트 서버로 이동
2 parents 8645203 + af2406a commit 03b3179

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

backend/src/main/java/site/coduo/timer/service/SchedulerService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ private void reset(final String key, final Timer timer) {
8787
timestampRegistry.register(key, initalTimer);
8888
}
8989

90-
public void notifyTimerStatus(final String key, final String sessionId) {
90+
public void notifyTimerStatus(final String key) {
9191
if (schedulerRegistry.isActive(key)) {
92-
timerStompManager.sendStatusToUser(sessionId, key, TimerStatus.RUNNING);
92+
timerStompManager.sendStatus(key, TimerStatus.RUNNING);
9393
}
9494
}
9595

backend/src/main/java/site/coduo/timer/service/TimerStompManager.java

-8
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ public void sendStatus(final String accessCode, final TimerStatus status) {
2626
);
2727
}
2828

29-
public void sendStatusToUser(final String sessionId, final String accessCode, final TimerStatus status) {
30-
simpMessagingTemplate.convertAndSendToUser(
31-
sessionId,
32-
String.format(STATUS_DESTINATION, accessCode),
33-
new TimerStatusResponse(status.getMessage(), null)
34-
);
35-
}
36-
3729
public void sendTime(final String accessCode, final long time) {
3830
simpMessagingTemplate.convertAndSend(String.format(TIME_DESTINATION, accessCode), new TimerStartResponse(time));
3931
}

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ public void onSubscription(final SessionSubscribeEvent event) {
3131
}
3232
final String key = parsePairRoomKey(destination);
3333
if (timerStompManager.isTimerStatusDestination(key, destination)) {
34-
final String sessionId = headerAccessor.getSessionId();
35-
schedulerService.notifyTimerStatus(key, sessionId);
34+
schedulerService.notifyTimerStatus(key);
3635
}
3736
}
3837

0 commit comments

Comments
 (0)