修改重复的订阅报错的bug

This commit is contained in:
wangjian 2023-04-05 21:57:41 +08:00
parent abb93c020f
commit a4ea724bab
1 changed files with 10 additions and 11 deletions

View File

@ -6,7 +6,6 @@ import (
"sync"
"git.hpds.cc/Component/network/frame"
herr "git.hpds.cc/Component/network/hpds_err"
"git.hpds.cc/Component/network/metadata"
)
@ -64,16 +63,16 @@ func (r *defaultRoute) Add(connId string, name string, observeDataTags []frame.T
return fmt.Errorf("SFN[%s] does not exist in config functions", name)
}
LOOP:
for _, conn := range r.data {
for connId, n := range conn {
if n == name {
err = herr.NewDuplicateNameError(connId, fmt.Errorf("SFN[%s] is already linked to another connection", name))
delete(conn, connId)
break LOOP
}
}
}
//LOOP:
//for _, conn := range r.data {
// for connId, n := range conn {
// if n == name {
// err = herr.NewDuplicateNameError(connId, fmt.Errorf("SFN[%s] is already linked to another connection", name))
// delete(conn, connId)
// break LOOP
// }
// }
//}
for _, tag := range observeDataTags {
conn := r.data[tag]