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 {