From 1dff16a86e9172e76f36ca2892eea95f75938586 Mon Sep 17 00:00:00 2001 From: mountain Date: Fri, 28 Jul 2023 09:40:53 +0900 Subject: [PATCH] =?UTF-8?q?sh=20mainloop=EB=8F=84=20waitgroup=EC=97=90=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wshandler/wshandler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wshandler/wshandler.go b/wshandler/wshandler.go index 531072b..0f0e9d1 100644 --- a/wshandler/wshandler.go +++ b/wshandler/wshandler.go @@ -243,6 +243,7 @@ func (ws *WebsocketHandler) Start(ctx context.Context) { sh.callReceiver = &chainReceiver{chain: sh.receiverChain} } + sh.connWaitGroup.Add(1) go sh.mainLoop(ctx) } } @@ -312,6 +313,7 @@ func (ws *WebsocketHandler) LeaveRoom(region string, room string, accid primitiv func (sh *subhandler) mainLoop(ctx context.Context) { defer func() { + sh.connWaitGroup.Done() s := recover() if s != nil { logger.Error(s)