refactor(user): do not timeout registered users
Avoid removing registered users on join timeout. This registered users cleanup routine should be deprecated since guest users do not have a join timeout anymore.
This commit is contained in:
parent
d85f857220
commit
84bf1bfce9
@ -19,8 +19,6 @@ trait SystemConfiguration {
|
||||
lazy val expireLastUserLeft = Try(config.getInt("expire.lastUserLeft")).getOrElse(60) // 1 minute
|
||||
lazy val expireNeverJoined = Try(config.getInt("expire.neverJoined")).getOrElse(5 * 60) // 5 minutes
|
||||
|
||||
lazy val maxRegUserToJoinTime = Try(config.getInt("expire.maxRegUserToJoin")).getOrElse(5 * 60) // 5 minutes
|
||||
|
||||
lazy val analyticsChannel = Try(config.getString("eventBus.analyticsChannel")).getOrElse("analytics-channel")
|
||||
lazy val meetingManagerChannel = Try(config.getString("eventBus.meetingManagerChannel")).getOrElse("MeetingManagerChannel")
|
||||
lazy val outMessageChannel = Try(config.getString("eventBus.outMessageChannel")).getOrElse("OutgoingMessageChannel")
|
||||
|
@ -21,7 +21,6 @@ object RegisteredUsers {
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
loggedOut,
|
||||
)
|
||||
}
|
||||
@ -42,10 +41,6 @@ object RegisteredUsers {
|
||||
users.toVector.filter(ru => id == ru.externId)
|
||||
}
|
||||
|
||||
def findUsersNotJoined(users: RegisteredUsers): Vector[RegisteredUser] = {
|
||||
users.toVector.filter(u => u.joined == false && u.markAsJoinTimedOut == false)
|
||||
}
|
||||
|
||||
def getRegisteredUserWithToken(token: String, userId: String, regUsers: RegisteredUsers): Option[RegisteredUser] = {
|
||||
def isSameUserId(ru: RegisteredUser, userId: String): Option[RegisteredUser] = {
|
||||
if (userId.startsWith(ru.id)) {
|
||||
@ -135,12 +130,6 @@ object RegisteredUsers {
|
||||
u
|
||||
}
|
||||
|
||||
def markAsUserFailedToJoin(users: RegisteredUsers, user: RegisteredUser): RegisteredUser = {
|
||||
val u = user.copy(markAsJoinTimedOut = true)
|
||||
users.save(u)
|
||||
u
|
||||
}
|
||||
|
||||
def setUserLoggedOutFlag(users: RegisteredUsers, user: RegisteredUser): RegisteredUser = {
|
||||
val u = user.copy(loggedOut = true)
|
||||
users.save(u)
|
||||
@ -182,7 +171,6 @@ case class RegisteredUser(
|
||||
registeredOn: Long,
|
||||
lastAuthTokenValidatedOn: Long,
|
||||
joined: Boolean,
|
||||
markAsJoinTimedOut: Boolean,
|
||||
banned: Boolean,
|
||||
loggedOut: Boolean
|
||||
)
|
||||
|
@ -751,7 +751,6 @@ class MeetingActor(
|
||||
setRecordingChapterBreak()
|
||||
|
||||
processUserInactivityAudit()
|
||||
flagRegisteredUsersWhoHasNotJoined()
|
||||
checkIfNeedToEndMeetingWhenNoAuthedUsers(liveMeeting)
|
||||
checkIfNeedToEndMeetingWhenNoModerators(liveMeeting)
|
||||
}
|
||||
@ -970,22 +969,6 @@ class MeetingActor(
|
||||
}
|
||||
}
|
||||
|
||||
def flagRegisteredUsersWhoHasNotJoined(): Unit = {
|
||||
val users = RegisteredUsers.findUsersNotJoined(liveMeeting.registeredUsers)
|
||||
users foreach { u =>
|
||||
val now = System.currentTimeMillis()
|
||||
if (now - u.registeredOn > TimeUtil.secondsToMillis(maxRegUserToJoinTime)) {
|
||||
RegisteredUsers.markAsUserFailedToJoin(liveMeeting.registeredUsers, u)
|
||||
val event = MsgBuilder.buildRegisteredUserJoinTimeoutMsg(
|
||||
liveMeeting.props.meetingProp.intId,
|
||||
u.id,
|
||||
u.name
|
||||
)
|
||||
outGW.send(event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def handleCheckRunningAndRecordingVoiceConfEvtMsg(msg: CheckRunningAndRecordingVoiceConfEvtMsg): Unit = {
|
||||
//msg.body.confRecordings foreach { cr =>
|
||||
// println("rec = " + cr.recordPath)
|
||||
|
@ -40,7 +40,6 @@ class AnalyticsActor(val includeChat: Boolean) extends Actor with ActorLogging {
|
||||
case m: GetRunningMeetingsReqMsg => logMessage(msg)
|
||||
|
||||
case m: RegisterUserReqMsg => logMessage(msg)
|
||||
case m: RegisteredUserJoinTimeoutMsg => logMessage(msg)
|
||||
case m: UserRegisteredRespMsg => logMessage(msg)
|
||||
case m: DisconnectAllClientsSysMsg => logMessage(msg)
|
||||
case m: DisconnectClientSysMsg => logMessage(msg)
|
||||
|
@ -424,15 +424,6 @@ object MsgBuilder {
|
||||
BbbCommonEnvCoreMsg(envelope, event)
|
||||
}
|
||||
|
||||
def buildRegisteredUserJoinTimeoutMsg(meetingId: String, userId: String, name: String): BbbCommonEnvCoreMsg = {
|
||||
val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka")
|
||||
val envelope = BbbCoreEnvelope(RegisteredUserJoinTimeoutMsg.NAME, routing)
|
||||
val header = BbbCoreHeaderWithMeetingId(RegisteredUserJoinTimeoutMsg.NAME, meetingId)
|
||||
val body = RegisteredUserJoinTimeoutMsgBody(meetingId, userId, name)
|
||||
val event = RegisteredUserJoinTimeoutMsg(header, body)
|
||||
BbbCommonEnvCoreMsg(envelope, event)
|
||||
}
|
||||
|
||||
def buildGetScreenSubscribePermissionRespMsg(
|
||||
meetingId: String,
|
||||
voiceConf: String,
|
||||
|
@ -39,7 +39,6 @@ expire {
|
||||
# time in seconds
|
||||
lastUserLeft = 60
|
||||
neverJoined = 300
|
||||
maxRegUserToJoin = 300
|
||||
}
|
||||
|
||||
services {
|
||||
|
@ -25,13 +25,6 @@ case class UserRegisteredRespMsg(
|
||||
case class UserRegisteredRespMsgBody(meetingId: String, userId: String, name: String,
|
||||
role: String, excludeFromDashboard: Boolean, registeredOn: Long)
|
||||
|
||||
object RegisteredUserJoinTimeoutMsg { val NAME = "RegisteredUserJoinTimeoutMsg" }
|
||||
case class RegisteredUserJoinTimeoutMsg(
|
||||
header: BbbCoreHeaderWithMeetingId,
|
||||
body: RegisteredUserJoinTimeoutMsgBody
|
||||
) extends BbbCoreMsg
|
||||
case class RegisteredUserJoinTimeoutMsgBody(meetingId: String, userId: String, name: String)
|
||||
|
||||
object ValidateAuthTokenReqMsg {
|
||||
val NAME = "ValidateAuthTokenReqMsg"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user