잦은 redis call 회피
This commit is contained in:
@ -339,7 +339,7 @@ func (sh *subhandler) mainLoop(ctx context.Context) {
|
||||
room = makeRoom(name, roomDestroyChan)
|
||||
rooms[name] = room
|
||||
room.start(ctx)
|
||||
go sh.callReceiver.OnRoomCreated(sh.region, name)
|
||||
sh.callReceiver.OnRoomCreated(sh.region, name)
|
||||
}
|
||||
return room
|
||||
}
|
||||
@ -352,7 +352,7 @@ func (sh *subhandler) mainLoop(ctx context.Context) {
|
||||
select {
|
||||
case destroyedRoom := <-roomDestroyChan:
|
||||
delete(rooms, destroyedRoom)
|
||||
go sh.callReceiver.OnRoomDestroyed(sh.region, destroyedRoom)
|
||||
sh.callReceiver.OnRoomDestroyed(sh.region, destroyedRoom)
|
||||
|
||||
case usermsg := <-sh.localDeliveryChan:
|
||||
// 로컬에 connection이 있는지 먼저 확인해 보기 위한 채널
|
||||
@ -475,10 +475,10 @@ func (sh *subhandler) mainLoop(ctx context.Context) {
|
||||
room.out(c)
|
||||
}
|
||||
c.joinedRooms = nil
|
||||
go sh.callReceiver.OnClientMessageReceived(c.sender, Disconnected, nil)
|
||||
sh.callReceiver.OnClientMessageReceived(c.sender, Disconnected, nil)
|
||||
} else {
|
||||
entireConns[c.sender.Accid.Hex()] = c
|
||||
go sh.callReceiver.OnClientMessageReceived(c.sender, Connected, nil)
|
||||
sh.callReceiver.OnClientMessageReceived(c.sender, Connected, nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user