Make breakout rooms expire only by their duration.

This commit is contained in:
Ghazi Triki 2018-05-11 16:50:12 +01:00
parent 7b4d0781ed
commit 48b695697e
3 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -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),

View File

@ -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,