Delay room manager close to ensure correct DisconnectReason is sent (#806)
This commit is contained in:
@@ -385,6 +385,9 @@ func (r *RoomManager) getOrCreateRoom(ctx context.Context, roomName livekit.Room
|
|||||||
// manages an RTC session for a participant, runs on the RTC node
|
// manages an RTC session for a participant, runs on the RTC node
|
||||||
func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.LocalParticipant, requestSource routing.MessageSource) {
|
func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.LocalParticipant, requestSource routing.MessageSource) {
|
||||||
defer func() {
|
defer func() {
|
||||||
|
// give time for the participant to be closed with a proper reason.
|
||||||
|
// if participant is closed from here, we would be obscuring the real reason the participant is closed.
|
||||||
|
time.Sleep(2 * time.Second)
|
||||||
logger.Debugw("RTC session finishing",
|
logger.Debugw("RTC session finishing",
|
||||||
"participant", participant.Identity(),
|
"participant", participant.Identity(),
|
||||||
"pID", participant.ID(),
|
"pID", participant.ID(),
|
||||||
|
|||||||
Reference in New Issue
Block a user