- end the meeting asap when the last user leaves by setting meetingExpireWhenLastUserLeftInMinutes=0 in

bbb-web's bigbluebutton.properties
This commit is contained in:
Richard Alam 2018-11-16 10:36:10 -08:00
parent d3f0176745
commit ff3f8239c8
3 changed files with 15 additions and 5 deletions

View File

@ -60,7 +60,10 @@ case class MeetingExpiryTracker(
val expire = for {
lastUserLeftOn <- lastUserLeftOnInMs
} yield {
timestampInMs - lastUserLeftOn > meetingExpireWhenLastUserLeftInMs
// Check if we need to end meeting right away when the last user left
// ralam Nov 16, 2018
if (meetingExpireWhenLastUserLeftInMs == 0) true
else timestampInMs - lastUserLeftOn > meetingExpireWhenLastUserLeftInMs
}
expire.getOrElse(false)

View File

@ -39,9 +39,16 @@ object Users2x {
}
}
def findAllExpiredUserLeftFlags(users: Users2x): Vector[UserState] = {
users.toVector filter (u => u.userLeftFlag.left && u.userLeftFlag.leftOn != 0 &&
System.currentTimeMillis() - u.userLeftFlag.leftOn > 10000)
def findAllExpiredUserLeftFlags(users: Users2x, meetingExpireWhenLastUserLeftInMs: Long): Vector[UserState] = {
if (meetingExpireWhenLastUserLeftInMs > 0) {
users.toVector filter (u => u.userLeftFlag.left && u.userLeftFlag.leftOn != 0 &&
System.currentTimeMillis() - u.userLeftFlag.leftOn > 1000)
} else {
// When meetingExpireWhenLastUserLeftInMs is set zero we need to
// remove user right away to end the meeting as soon as possible.
// ralam Nov 16, 2018
users.toVector filter (u => u.userLeftFlag.left && u.userLeftFlag.leftOn != 0)
}
}
def numUsers(users: Users2x): Int = {

View File

@ -573,7 +573,7 @@ class MeetingActor(
}
def removeUsersWithExpiredUserLeftFlag(liveMeeting: LiveMeeting, state: MeetingState2x): MeetingState2x = {
val leftUsers = Users2x.findAllExpiredUserLeftFlags(liveMeeting.users2x)
val leftUsers = Users2x.findAllExpiredUserLeftFlags(liveMeeting.users2x, expiryTracker.meetingExpireWhenLastUserLeftInMs)
leftUsers foreach { leftUser =>
for {
u <- Users2x.remove(liveMeeting.users2x, leftUser.intId)