sh mainloop도 waitgroup에 추가

This commit is contained in:
2023-07-28 09:40:53 +09:00
parent 8ea2a698ce
commit 1dff16a86e

View File

@ -243,6 +243,7 @@ func (ws *WebsocketHandler) Start(ctx context.Context) {
sh.callReceiver = &chainReceiver{chain: sh.receiverChain} sh.callReceiver = &chainReceiver{chain: sh.receiverChain}
} }
sh.connWaitGroup.Add(1)
go sh.mainLoop(ctx) 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) { func (sh *subhandler) mainLoop(ctx context.Context) {
defer func() { defer func() {
sh.connWaitGroup.Done()
s := recover() s := recover()
if s != nil { if s != nil {
logger.Error(s) logger.Error(s)