Skip to content

[BE] 특정 사용자에게만 타이머 상태 전송 -> 모든 구독자에게 전송하도록 롤백 #1185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ private void reset(final String key, final Timer timer) {
timestampRegistry.register(key, initalTimer);
}

public void notifyTimerStatus(final String key, final String sessionId) {
public void notifyTimerStatus(final String key) {
if (schedulerRegistry.isActive(key)) {
timerStompManager.sendStatusToUser(sessionId, key, TimerStatus.RUNNING);
timerStompManager.sendStatus(key, TimerStatus.RUNNING);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ public void sendStatus(final String accessCode, final TimerStatus status) {
);
}

public void sendStatusToUser(final String sessionId, final String accessCode, final TimerStatus status) {
simpMessagingTemplate.convertAndSendToUser(
sessionId,
String.format(STATUS_DESTINATION, accessCode),
new TimerStatusResponse(status.getMessage(), null)
);
}

public void sendTime(final String accessCode, final long time) {
simpMessagingTemplate.convertAndSend(String.format(TIME_DESTINATION, accessCode), new TimerStartResponse(time));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public void onSubscription(final SessionSubscribeEvent event) {
}
final String key = parsePairRoomKey(destination);
if (timerStompManager.isTimerStatusDestination(key, destination)) {
final String sessionId = headerAccessor.getSessionId();
schedulerService.notifyTimerStatus(key, sessionId);
schedulerService.notifyTimerStatus(key);
}
}

Expand Down
Loading