Commit 1453f4e6 by 杨林龙

减少gps基站保存时间间隔

1 parent 56bd873a
...@@ -39,7 +39,7 @@ public class TransitHandleService { ...@@ -39,7 +39,7 @@ public class TransitHandleService {
/** /**
* 间隔时间 * 间隔时间
*/ */
private static final int STEP = 5000; private static final int STEP = 3000;
/** /**
...@@ -72,7 +72,7 @@ public class TransitHandleService { ...@@ -72,7 +72,7 @@ public class TransitHandleService {
redisUtils.set(setKey(deviceLocationDto.getSn()), deviceLocationCache); redisUtils.set(setKey(deviceLocationDto.getSn()), deviceLocationCache);
deviceLocationMap.put(deviceLocationDto.getSn(), deviceLocationCache); deviceLocationMap.put(deviceLocationDto.getSn(), deviceLocationCache);
// 当数据大小为200个的时候 保存一次 // 当数据大小为100个的时候 保存一次
if (deviceLocationMap.size() == 100 || System.currentTimeMillis() >= tempTime + STEP) { if (deviceLocationMap.size() == 100 || System.currentTimeMillis() >= tempTime + STEP) {
log.info("开始插入或者更新Gps和基站的数据大小===" + deviceLocationMap.size()); log.info("开始插入或者更新Gps和基站的数据大小===" + deviceLocationMap.size());
remoteDeviceLocationService.saveOrUpdateDeviceLocationData(deviceLocationMap.values()); remoteDeviceLocationService.saveOrUpdateDeviceLocationData(deviceLocationMap.values());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!