mirror of
https://github.com/livekit/livekit.git
synced 2026-08-27 11:19:45 +00:00
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
|
||||
}
|
||||
|
||||
reason := types.ParticipantCloseReasonClientRequestLeave
|
||||
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 {
|
||||
lp.AddOnClose(types.ParticipantCloseKeyWHIP, nil)
|
||||
room.RemoveParticipant(
|
||||
lp.Identity(),
|
||||
lp.ID(),
|
||||
reason,
|
||||
types.ParticipantCloseReasonClientRequestLeave,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user