修复同属多集群下的节点无法删除线路的Bug

This commit is contained in:
刘祥超
2021-10-12 08:40:39 +08:00
parent 29cd7da6e4
commit ea19635fe5

View File

@@ -1328,6 +1328,7 @@ func (this *NodeService) UpdateNodeDNS(ctx context.Context, req *pb.UpdateNodeDN
delete(routeCodeMap, req.DnsDomainId) delete(routeCodeMap, req.DnsDomainId)
} }
} else { } else {
routeCodeMap = map[int64][]string{}
if len(req.Routes) > 0 { if len(req.Routes) > 0 {
var m = map[int64][]string{} // domainId => codes var m = map[int64][]string{} // domainId => codes
for _, route := range req.Routes { for _, route := range req.Routes {
@@ -1342,9 +1343,6 @@ func (this *NodeService) UpdateNodeDNS(ctx context.Context, req *pb.UpdateNodeDN
for domainId, codes := range m { for domainId, codes := range m {
routeCodeMap[domainId] = codes routeCodeMap[domainId] = codes
} }
} else {
// 清空
routeCodeMap = map[int64][]string{}
} }
} }