[8.2.0][opt]降低同步云端途经点的频率
This commit is contained in:
@@ -131,8 +131,8 @@ object SynchDataModel {
|
||||
private val isRequestingContrainInfo = AtomicBoolean(false)
|
||||
|
||||
|
||||
fun synContraiInfo(needUpdatePoint: MutableList<Long>, updateAll: Boolean = false) {
|
||||
if (!updateAll) waitSysData.addAll(needUpdatePoint)
|
||||
fun synContraiInfo(needUpdatePoint: MutableList<Long>) {
|
||||
waitSysData.addAll(needUpdatePoint)
|
||||
if(isRequestingContrainInfo.get()){
|
||||
// 正在请求
|
||||
OchChainLogManager.writeChainLogNet(false,"同步轨迹","正在同步轨迹请稍等 ")
|
||||
@@ -141,12 +141,8 @@ object SynchDataModel {
|
||||
isRequestingContrainInfo.set(true)
|
||||
|
||||
val lines = mutableListOf<Long>()
|
||||
if (updateAll) {
|
||||
lines.addAll(needUpdatePoint)
|
||||
} else {
|
||||
waitSysData.forEach {
|
||||
lines.add(it)
|
||||
}
|
||||
waitSysData.forEach {
|
||||
lines.add(it)
|
||||
}
|
||||
OchChainLogManager.writeChainLogNet(false,"同步轨迹","轨迹变更需同步禁行点和途径点 线路:${lines}")
|
||||
RepositoryManager.queryPointFromNet(lines)
|
||||
@@ -174,16 +170,12 @@ object SynchDataModel {
|
||||
try {
|
||||
i(TAG, "途经点和轨迹信息为:${data}")
|
||||
PointDb.addOrUpdate(data)
|
||||
if (!updateAll) {
|
||||
for (datum in data) {
|
||||
waitSysData.remove(datum.lineId)
|
||||
}
|
||||
for (datum in data) {
|
||||
waitSysData.remove(datum.lineId)
|
||||
}
|
||||
isRequestingContrainInfo.set(false)
|
||||
if (!updateAll) {
|
||||
if(waitSysData.isNotEmpty()){
|
||||
synContraiInfo(needUpdatePoint)
|
||||
}
|
||||
if(waitSysData.isNotEmpty()){
|
||||
synContraiInfo(needUpdatePoint)
|
||||
}
|
||||
OchChainLogManager.writeChainLogNet(false,"同步轨迹","网络请求重构 轨迹信息${data}")
|
||||
d(TAG, "同步轨迹网络成功")
|
||||
|
||||
Reference in New Issue
Block a user