|
|
@ -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 { |
|
|
|