REM:
1.删除多余代码
2.同步缓存和数据库信息
This commit is contained in:
chenlinghy 2021-01-21 18:47:58 +08:00
parent e782872b5b
commit db5f8d36e2
1 changed files with 43 additions and 49 deletions

View File

@ -586,23 +586,6 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
}
}
// dpBypassManager.getProtectObject().values().forEach(v -> {
// String serviceId = v.getProtectName()
// .replace(objectPrefix + "_", "")
// .replace("_" + IpAddrType.IPV4.getDescription(), "")
// .replace("_" + IpAddrType.IPV6.getDescription(), "");
//
// // UMC上面存在对象已经失效
// if (disposeServiceGroup.values().stream().noneMatch(k -> serviceId.equals(k.getServiceId()))) {
// log.info("++++Remove UMC Unused Protect Object: {}", v.getProtectName());
// ErrorCode err = removeProtectObject(v.getProtectName());
//
// if (err != ErrorCode.ERR_OK) {
// log.error("!!!!Remove Protect Object Error: {}", v.getProtectName());
// }
// }
// });
}
/**
@ -1026,9 +1009,20 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
disposeServiceGroup.put(v.getServiceId(), v);
}
} else {
//缓存和数据库中都不存在则添加进缓存
disposeServiceGroup.put(v.getServiceId(), v);
}
}
List<String> expireKey = new ArrayList<>();
for (String v : disposeServiceGroup.keySet()) {
if (svrList.stream().noneMatch(k -> k.getServiceId().equals(v))) {
expireKey.add(v);
}
}
expireKey.forEach(disposeServiceGroup::remove);
}
/**