From bd30648a42c7b4f67a2434f2f7cf5a2e9cc596c0 Mon Sep 17 00:00:00 2001 From: kelly6bf Date: Mon, 18 Nov 2024 17:20:18 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20#961=20SchedulerService=20WS=20?= =?UTF-8?q?=EC=82=BD=EC=9E=85=20=EA=B5=AC=EA=B0=84=20=EB=A7=88=ED=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/site/coduo/sync/service/SchedulerService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/main/java/site/coduo/sync/service/SchedulerService.java b/backend/src/main/java/site/coduo/sync/service/SchedulerService.java index 8cc4795f9..cba6a6378 100644 --- a/backend/src/main/java/site/coduo/sync/service/SchedulerService.java +++ b/backend/src/main/java/site/coduo/sync/service/SchedulerService.java @@ -32,6 +32,7 @@ public void start(final String key) { if (schedulerRegistry.isActive(key)) { return; } + // TODO : WS로 전환 sseService.broadcast(key, "timer", "start"); if (isInitial(key)) { final Timer timer = timerRepository.fetchTimerByAccessCode(key) @@ -59,11 +60,13 @@ private void runTimer(final String key, final Timer timer) { stop(key, timer); return; } + // TODO : WS로 전환 if (sseService.hasNoConnections(key) && schedulerRegistry.has(key)) { pause(key); return; } timer.decreaseRemainingTime(DELAY_SECOND.toMillis()); + // TODO : WS로 전환 sseService.broadcast(key, "remaining-time", String.valueOf(timer.getRemainingTime())); } @@ -75,6 +78,7 @@ public void pause(final String key) { } private void stop(final String key, final Timer timer) { + // TODO : WS로 전환 sseService.broadcast(key, "timer", "stop"); schedulerRegistry.release(key); final Timer initalTimer = new Timer(timer.getAccessCode(), timer.getDuration(), timer.getDuration());