diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala index dbfaf750bf..4e5d0b1511 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala @@ -14,6 +14,7 @@ import org.bigbluebutton.SystemConfiguration import java.util.concurrent.TimeUnit import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.db.{ DatabaseConnection, MeetingDAO } +import org.bigbluebutton.core.domain.MeetingEndReason import org.bigbluebutton.core.running.RunningMeeting import org.bigbluebutton.core.util.ColorPicker import org.bigbluebutton.core2.RunningMeetings @@ -57,6 +58,9 @@ class BigBlueButtonActor( override def preStart() { bbbMsgBus.subscribe(self, meetingManagerChannel) DatabaseConnection.initialize() + + //Terminate all previous meetings, as they will not function following the akka-apps restart + MeetingDAO.setAllMeetingsEnded(MeetingEndReason.ENDED_DUE_TO_SERVICE_INTERRUPTION, "system") } override def postStop() { diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/MeetingDAO.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/MeetingDAO.scala index 6d323b4ff0..08d048b0ab 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/MeetingDAO.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/MeetingDAO.scala @@ -182,4 +182,27 @@ object MeetingDAO { case Failure(e) => DatabaseConnection.logger.debug(s"Error updating endedAt=now() Meeting: $e") } } + + def setAllMeetingsEnded(endedReasonCode: String, endedBy: String) = { + DatabaseConnection.db.run( + TableQuery[MeetingDbTableDef] + .filter(_.endedAt.isEmpty) + .map(a => (a.endedAt, a.endedReasonCode, a.endedBy)) + .update( + ( + Some(new java.sql.Timestamp(System.currentTimeMillis())), + Some(endedReasonCode), + endedBy match { + case "" => None + case c => Some(c) + } + ) + ) + ).onComplete { + case Success(rowsAffected) => DatabaseConnection.logger.debug(s"$rowsAffected row(s) updated all-meetings endedAt=now() on Meeting table!") + case Failure(e) => DatabaseConnection.logger.debug(s"Error updating all-meetings endedAt=now() on Meeting table: $e") + } + } + + } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala index 2213e9e449..1012908fe9 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala @@ -42,4 +42,5 @@ object MeetingEndReason { val BREAKOUT_ENDED_BY_MOD = "BREAKOUT_ENDED_BY_MOD" val ENDED_DUE_TO_NO_AUTHED_USER = "ENDED_DUE_TO_NO_AUTHED_USER" val ENDED_DUE_TO_NO_MODERATOR = "ENDED_DUE_TO_NO_MODERATOR" + val ENDED_DUE_TO_SERVICE_INTERRUPTION = "ENDED_DUE_TO_SERVICE_INTERRUPTION" } diff --git a/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/component.tsx b/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/component.tsx index 05f71c32e9..8a46584910 100644 --- a/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/component.tsx +++ b/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/component.tsx @@ -159,6 +159,10 @@ const intlMessage = defineMessages({ id: 'app.meeting.endedDueNoModerators', description: '', }, + [MeetingEndedTable.ENDED_DUE_TO_SERVICE_INTERRUPTION]: { + id: 'app.meeting.endedDueServiceInterruption', + description: '', + }, }); interface MeetingEndedContainerProps { diff --git a/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/service.ts b/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/service.ts index 688d120cf3..542a39d4b6 100644 --- a/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/service.ts +++ b/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/service.ts @@ -21,6 +21,7 @@ export const MeetingEndedTable = { BREAKOUT_ENDED_BY_MOD: 'BREAKOUT_ENDED_BY_MOD', ENDED_DUE_TO_NO_AUTHED_USER: 'ENDED_DUE_TO_NO_AUTHED_USER', ENDED_DUE_TO_NO_MODERATOR: 'ENDED_DUE_TO_NO_MODERATOR', + ENDED_DUE_TO_SERVICE_INTERRUPTION: 'ENDED_DUE_TO_SERVICE_INTERRUPTION', }; export const openLearningDashboardUrl = ( diff --git a/bigbluebutton-html5/public/locales/en.json b/bigbluebutton-html5/public/locales/en.json index c0e9a7e192..a0e8845706 100755 --- a/bigbluebutton-html5/public/locales/en.json +++ b/bigbluebutton-html5/public/locales/en.json @@ -244,6 +244,7 @@ "app.meeting.breakoutEndedByModerator": "Breakout was terminated by Moderator", "app.meeting.endedDueNoAuthed": "the meeting was ended because no authed user in the room", "app.meeting.endedDueNoModerators": "The meeting has ended because no moderator has been present in the meeting", + "app.meeting.endedDueServiceInterruption": "The meeting has terminated due to a temporary service interruption", "app.meeting.meetingTimeRemaining": "Meeting time remaining: {0}", "app.meeting.meetingTimeHasEnded": "Time ended. Meeting will close soon", "app.meeting.endedByUserMessage": "This session was ended by {0}",