From b69d0498aa061cbce5531427a76d113686ec1aae Mon Sep 17 00:00:00 2001 From: wuyuan <15505152113@163.com> Date: Tue, 1 Apr 2025 15:02:15 +0800 Subject: [PATCH] 11 --- .../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 {