From a23584f415407200e96157b9d6a1fea6876ce46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=8E=89=E4=B8=9C?= <129883742+liyudong2018@users.noreply.github.com> Date: Sat, 20 Sep 2025 11:12:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/hivekion/room/bean/Room.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hivekion/room/bean/Room.java b/src/main/java/com/hivekion/room/bean/Room.java index 0e9b211..7fc1543 100644 --- a/src/main/java/com/hivekion/room/bean/Room.java +++ b/src/main/java/com/hivekion/room/bean/Room.java @@ -102,6 +102,15 @@ public class Room implements AutoCloseable { public void stop() { status.set(false); cancelTask(); + futures.forEach((key, value) -> { + try { + if (!value.isShutdown()) { + value.shutdownNow(); + } + } catch (Exception e) { + log.error("error::", e); + } + }); } /** @@ -122,7 +131,6 @@ public class Room implements AutoCloseable { } - // 启动定时任务 private void startTask() { if (future == null || future.isCancelled()) { @@ -197,8 +205,9 @@ public class Room implements AutoCloseable { public boolean isRunning() { return status.get(); } + //统一推送方法 - protected void pushStatus(String resourceId){ + protected void pushStatus(String resourceId) { } }