fix: 支持kvdb依赖包安装,公共参数异常删除处理避免数据异常

This commit is contained in:
TsMask
2024-07-09 16:13:30 +08:00
parent 46f2c8fc89
commit b1ca797266
3 changed files with 34 additions and 14 deletions

View File

@@ -679,6 +679,18 @@ func (r *NeInfoImpl) NeConfPara5GWirte(content map[string]any, syncNE []string)
// NeConfPara5GConvert 网元公共配置数据转化 content网元公共配置文件读取内容
func (r *NeInfoImpl) neConfPara5GDataConvert(content map[string]any) map[string]string {
defer func() {
if err := recover(); err != nil {
logger.Errorf("NeConfPara5GDataConvert panic: %v", err)
// 文件异常就删除配置
omcFilePath := "/usr/local/etc/omc/para5G.yaml"
if runtime.GOOS == "windows" {
omcFilePath = fmt.Sprintf("C:%s", omcFilePath)
}
os.Remove(omcFilePath)
}
}()
basic := content["basic"].(map[string]any)
external := content["external"].(map[string]any)
sbi := content["sbi"].(map[string]any)
@@ -771,7 +783,6 @@ func (r *NeInfoImpl) neConfPara5GDataConvert(content map[string]any) map[string]
"AMF_IP": sbi["amf_ip"].(string),
"AUSF_IP": sbi["ausf_ip"].(string),
"UDM_IP": sbi["udm_ip"].(string),
"ADB_IP": sbi["adb_ip"].(string),
"SMF_IP": sbi["smf_ip"].(string),
"PCF_IP": sbi["pcf_ip"].(string),
"NSSF_IP": sbi["nssf_ip"].(string),
@@ -781,5 +792,7 @@ func (r *NeInfoImpl) neConfPara5GDataConvert(content map[string]any) map[string]
"NEF_IP": sbi["nef_ip"].(string),
"MME_IP": sbi["mme_ip"].(string),
"N3IWF_IP": sbi["n3iwf_ip"].(string),
"DB_IP": sbi["db_ip"].(string),
}
}