修改重复的订阅报错的bug
This commit is contained in:
parent
abb93c020f
commit
a4ea724bab
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue