Commit cd150fc4 authored by 赵啸非's avatar 赵啸非

添加告警统计信息

No related merge requests found
......@@ -233,7 +233,11 @@ public class DeviceApiController {
deviceEntity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
deviceEntity.setDeviceVersion(req.getDeviceVersion() == null ? "" : req.getDeviceVersion());
//todo 延迟队列更新 此时进入redis 队列
Long lpush = cacheService.lpush(RedisKey.KEY_DEVICE_ONLINE_QUEUE, deviceEntity);
DeviceEntity entity = new DeviceEntity();
entity.setId(deviceEntity.getId());
entity.setOnlineTime(new Date());
entity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
Long lpush = cacheService.lpush(RedisKey.KEY_DEVICE_ONLINE_QUEUE, entity);
log.info("lpush:{}",lpush);
//deviceService.getDeviceDao().update(deviceEntity);
......
......@@ -45,8 +45,8 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
List<DeviceEntity> waitDeviceInfos = new ArrayList<>();
while (true) {
DeviceEntity deviceEntity = cacheService.lpop(RedisKey.KEY_DEVICE_ONLINE_QUEUE, DeviceEntity.class);
log.info("deviceEntity:{}",deviceEntity==null);
if (ObjectUtils.isEmpty(deviceEntity)) {
log.info("等待更新队列为空!");
break;
} else {
waitDeviceInfos.add(deviceEntity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment