Clean code as there is no oss sweeper for ingress (#3918)

This commit is contained in:
cnderrauber
2025-09-11 16:44:52 +08:00
committed by GitHub
parent 5f561b4ff1
commit f4a06cf025
+1 -7
View File
@@ -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,
)
}