From 02f6e13e25e5d8cad6d37a3b2688086fdfcc5661 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 1 Jun 2022 17:02:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BD=91=E7=AE=A1=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/comp_gateroute.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/comp_gateroute.go b/services/comp_gateroute.go index e4b2bef9e..a8e51f9bb 100644 --- a/services/comp_gateroute.go +++ b/services/comp_gateroute.go @@ -52,7 +52,10 @@ func (this *SComp_GateRouteComp) Start() (err error) { //注册路由 func (this *SComp_GateRouteComp) RegisterRoute(methodName string, comp reflect.Value, msg reflect.Type, fn reflect.Method) { log.Debugf("注册用户路由【%s】", methodName) - if _, ok := this.msghandles[methodName]; ok { + this.mrlock.RLock() + _, ok := this.msghandles[methodName] + this.mrlock.RUnlock() + if ok { log.Errorf("重复 注册网关消息【%s】", methodName) return }