egress participants don't count towards max (#1279)
This commit is contained in:
+12
-3
@@ -230,9 +230,18 @@ func (r *Room) Join(participant types.LocalParticipant, opts *ParticipantOptions
|
|||||||
return ErrAlreadyJoined
|
return ErrAlreadyJoined
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.protoRoom.MaxParticipants > 0 && len(r.participants) >= int(r.protoRoom.MaxParticipants) {
|
if r.protoRoom.MaxParticipants > 0 && !participant.IsRecorder() {
|
||||||
prometheus.ServiceOperationCounter.WithLabelValues("participant_join", "error", "max_exceeded").Add(1)
|
participantCount := 0
|
||||||
return ErrMaxParticipantsExceeded
|
for _, p := range r.participants {
|
||||||
|
if !p.IsRecorder() {
|
||||||
|
participantCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if participantCount >= int(r.protoRoom.MaxParticipants) {
|
||||||
|
prometheus.ServiceOperationCounter.WithLabelValues("participant_join", "error", "max_exceeded").Add(1)
|
||||||
|
return ErrMaxParticipantsExceeded
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.FirstJoinedAt() == 0 {
|
if r.FirstJoinedAt() == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user