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)