Clean code as there is no oss sweeper for ingress (#3918)
This commit is contained in:
@@ -216,19 +216,13 @@ func (r whipParticipantService) DeleteSession(ctx context.Context, req *rpc.WHIP
|
|||||||
return nil, ErrRoomNotFound
|
return nil, ErrRoomNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
reason := types.ParticipantCloseReasonClientRequestLeave
|
|
||||||
lp := room.GetParticipantByID(livekit.ParticipantID(req.ParticipantId))
|
lp := room.GetParticipantByID(livekit.ParticipantID(req.ParticipantId))
|
||||||
if lp == nil && req.FromSweeper && req.ParticipantId == "" {
|
|
||||||
lp = room.GetParticipant(livekit.ParticipantIdentity(req.ParticipantIdentity))
|
|
||||||
reason = types.ParticipantCloseReasonStale
|
|
||||||
}
|
|
||||||
|
|
||||||
if lp != nil {
|
if lp != nil {
|
||||||
lp.AddOnClose(types.ParticipantCloseKeyWHIP, nil)
|
lp.AddOnClose(types.ParticipantCloseKeyWHIP, nil)
|
||||||
room.RemoveParticipant(
|
room.RemoveParticipant(
|
||||||
lp.Identity(),
|
lp.Identity(),
|
||||||
lp.ID(),
|
lp.ID(),
|
||||||
reason,
|
types.ParticipantCloseReasonClientRequestLeave,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user