From 61ac343f2ca24d36f3dd22b261baf244be372afe Mon Sep 17 00:00:00 2001 From: yangwei <867012372@qq.com> Date: Tue, 1 Apr 2025 15:07:20 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=201=E3=80=81=E4=BF=AE=E6=94=B9=E6=97=A0?= =?UTF-8?q?=E4=BA=BA=E6=9C=BA=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/sample/component/GlobalScheduleService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dk-modules/sample/src/main/java/org/dromara/sample/component/GlobalScheduleService.java b/dk-modules/sample/src/main/java/org/dromara/sample/component/GlobalScheduleService.java index bb00778..00026f3 100644 --- a/dk-modules/sample/src/main/java/org/dromara/sample/component/GlobalScheduleService.java +++ b/dk-modules/sample/src/main/java/org/dromara/sample/component/GlobalScheduleService.java @@ -42,7 +42,6 @@ public class GlobalScheduleService { @Scheduled(initialDelay = 10, fixedRate = 30, timeUnit = TimeUnit.SECONDS) private void deviceStatusListen() { int start = RedisConst.DEVICE_ONLINE_PREFIX.length(); - redisOpsUtils.getAllKeys(RedisConst.DEVICE_ONLINE_PREFIX + "*").forEach(key -> { long expire = redisOpsUtils.getExpire(key); if (expire <= 30) { @@ -50,6 +49,9 @@ public class GlobalScheduleService { if (null == device) { return; } + if(device.getWorkspaceId().isEmpty()){ + return; + } if (DeviceDomainEnum.DRONE == device.getDomain()) { deviceService.subDeviceOffline(key.substring(start)); } else {