1、去除只能订阅一次的问题
This commit is contained in:
parent
37f7ba99ea
commit
753c4fe9c8
23
router.go
23
router.go
|
@ -3,7 +3,6 @@ package hpds_node
|
|||
import (
|
||||
"fmt"
|
||||
"git.hpds.cc/Component/network"
|
||||
"git.hpds.cc/Component/network/hpds_err"
|
||||
"git.hpds.cc/pavement/hpds_node/config"
|
||||
"sync"
|
||||
)
|
||||
|
@ -51,17 +50,17 @@ func (r *route) Add(connId string, name string, observeDataTags []byte) (err err
|
|||
if !ok {
|
||||
return fmt.Errorf("SFN[%s] does not exist in config functions", name)
|
||||
}
|
||||
|
||||
LOOP:
|
||||
for _, connects := range r.data {
|
||||
for connKey, n := range connects {
|
||||
if n == name {
|
||||
err = hpds_err.NewDuplicateNameError(connKey, fmt.Errorf("node:Stream Function[%s] is already linked to another connection", name))
|
||||
delete(connects, connKey)
|
||||
break LOOP
|
||||
}
|
||||
}
|
||||
}
|
||||
//去除只能订阅一次的问题
|
||||
//LOOP:
|
||||
//for _, connects := range r.data {
|
||||
// for connKey, n := range connects {
|
||||
// if n == name {
|
||||
// err = hpds_err.NewDuplicateNameError(connKey, fmt.Errorf("node:Stream Function[%s] is already linked to another connection", name))
|
||||
// delete(connects, connKey)
|
||||
// break LOOP
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
for _, tag := range observeDataTags {
|
||||
connects := r.data[tag]
|
||||
|
|
Loading…
Reference in New Issue