Skip to content

Commit d046325

Browse files
committed
🔧 chore: cancelTimer 위치 변경
1 parent 257f09c commit d046325

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

backend/src/main/java/io/f1/backend/domain/game/app/RoomService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ public RoomListResponse getAllRooms() {
235235
public void chat(Long roomId, String sessionId, ChatMessage chatMessage) {
236236

237237
Room room = findRoom(roomId);
238-
timerService.cancelTimer(room);
239238

240239
String destination = getDestination(roomId);
241240

@@ -262,6 +261,8 @@ public void chat(Long roomId, String sessionId, ChatMessage chatMessage) {
262261
MessageType.SYSTEM_NOTICE,
263262
ofPlayerEvent(chatMessage.nickname(), RoomEventType.CORRECT_ANSWER));
264263

264+
timerService.cancelTimer(room);
265+
265266
// TODO : 게임 종료 로직 추가
266267
if (!timerService.validateCurrentRound(room)) {
267268
// 게임 종료 로직

backend/src/main/java/io/f1/backend/domain/game/app/TimerService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public boolean cancelTimer(Room room) {
8383
// 정답 맞혔어요 ~ 타이머 캔슬 부탁
8484
ScheduledFuture<?> timer = room.getTimer();
8585
if (timer != null && !timer.isDone()) {
86-
timer.cancel(false);
87-
return true;
86+
return timer.cancel(false);
8887
}
8988
return false;
9089
}

0 commit comments

Comments
 (0)