From 753c4fe9c8770098017575ce985951935e95e7c1 Mon Sep 17 00:00:00 2001 From: wangjian Date: Tue, 7 Mar 2023 17:48:26 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8E=BB=E9=99=A4=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E4=B8=80=E6=AC=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/router.go b/router.go index 585ba07..c8b5b44 100644 --- a/router.go +++ b/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]