Make breakout rooms expire only by their duration.
This commit is contained in:
parent
7b4d0781ed
commit
48b695697e
@ -37,6 +37,7 @@ case class MeetingInactivityTracker(
|
||||
case class MeetingExpiryTracker(
|
||||
startedOnInMs: Long,
|
||||
userHasJoined: Boolean,
|
||||
isBreakout: Boolean,
|
||||
lastUserLeftOnInMs: Option[Long],
|
||||
durationInMs: Long,
|
||||
meetingExpireIfNoUserJoinedInMs: Long,
|
||||
@ -65,11 +66,11 @@ case class MeetingExpiryTracker(
|
||||
}
|
||||
|
||||
def hasMeetingExpired(timestampInMs: Long): (Boolean, Option[String]) = {
|
||||
if (hasMeetingExpiredNeverBeenJoined(timestampInMs)) {
|
||||
if (hasMeetingExpiredNeverBeenJoined(timestampInMs) && !isBreakout) {
|
||||
(true, Some(MeetingEndReason.ENDED_WHEN_NOT_JOINED))
|
||||
} else if (meetingOverDuration(timestampInMs)) {
|
||||
(true, Some(MeetingEndReason.ENDED_AFTER_EXCEEDING_DURATION))
|
||||
} else if (hasMeetingExpiredAfterLastUserLeft(timestampInMs)) {
|
||||
} else if (hasMeetingExpiredAfterLastUserLeft(timestampInMs) && !isBreakout) {
|
||||
(true, Some(MeetingEndReason.ENDED_WHEN_LAST_USER_LEFT))
|
||||
} else {
|
||||
(false, None)
|
||||
|
@ -121,6 +121,7 @@ class MeetingActor(
|
||||
val expiryTracker = new MeetingExpiryTracker(
|
||||
startedOnInMs = TimeUtil.timeNowInMs(),
|
||||
userHasJoined = false,
|
||||
isBreakout = props.meetingProp.isBreakout,
|
||||
lastUserLeftOnInMs = None,
|
||||
durationInMs = TimeUtil.minutesToMillis(props.durationProps.duration),
|
||||
meetingExpireIfNoUserJoinedInMs = TimeUtil.minutesToMillis(props.durationProps.meetingExpireIfNoUserJoinedInMinutes),
|
||||
|
@ -42,6 +42,7 @@ class ValidateAuthTokenReqMsgHdlrTestsSpec extends TestKit(ActorSystem(
|
||||
val expiryTracker = new MeetingExpiryTracker(
|
||||
startedOnInMs = TimeUtil.timeNowInSeconds(),
|
||||
userHasJoined = false,
|
||||
isBreakout = false,
|
||||
lastUserLeftOnInMs = None,
|
||||
durationInMs = 120,
|
||||
meetingExpireIfNoUserJoinedInMs = 5,
|
||||
|
Loading…
Reference in New Issue
Block a user