Commit 48376da6 authored by 赵啸非's avatar 赵啸非

修改设备更新线程实现逻辑

parent 54104caa
......@@ -33,22 +33,20 @@ public class DeviceUpdateComsumerThread extends AbstractThread {
@Override
protected int getSleepTime() {
return 1000;
return 500;
}
@Override
protected void process() {
log.info("DeviceUpdateComsumerThread process");
List<DeviceEntity> waitUpdateDeviceList = new ArrayList<>();
while (true) {
DeviceEntity deviceEntity = cacheService.lpop(RedisKey.KEY_DEVICE_UPDATE_QUEUE, DeviceEntity.class);
if (ObjectUtils.isEmpty(deviceEntity)) {
log.info("deviceEntity:{}", deviceEntity == null);
break;
} else {
if (!ObjectUtils.isEmpty(deviceEntity)) {
// log.info("deviceEntity:{}", deviceEntity == null);
waitUpdateDeviceList.add(deviceEntity);
}
}
if (!ObjectUtils.isEmpty(waitUpdateDeviceList)) {
log.info("updateDeviceList size:{}", waitUpdateDeviceList.size());
......
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