Remove presentation from Postgres when presentation is deleted
This commit is contained in:
parent
49d60f6f88
commit
7dee20c3ec
@ -3,6 +3,7 @@ package org.bigbluebutton.core.apps.presentationpod
|
||||
import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait }
|
||||
import org.bigbluebutton.core.bus.MessageBus
|
||||
import org.bigbluebutton.core.db.PresPresentationDAO
|
||||
import org.bigbluebutton.core.domain.MeetingState2x
|
||||
import org.bigbluebutton.core.running.LiveMeeting
|
||||
|
||||
@ -38,6 +39,8 @@ trait RemovePresentationPubMsgHdlr extends RightsManagementTrait {
|
||||
val podId = msg.body.podId
|
||||
val presentationId = msg.body.presentationId
|
||||
|
||||
PresPresentationDAO.delete(presentationId)
|
||||
|
||||
val newState = for {
|
||||
pod <- PresentationPodsApp.getPresentationPod(state, podId)
|
||||
} yield {
|
||||
|
@ -114,4 +114,15 @@ object PresPresentationDAO {
|
||||
}
|
||||
}
|
||||
|
||||
def delete(presentationId: String) = {
|
||||
DatabaseConnection.db.run(
|
||||
TableQuery[PresPresentationDbTableDef]
|
||||
.filter(_.presentationId === presentationId)
|
||||
.delete
|
||||
).onComplete {
|
||||
case Success(rowAffected) => DatabaseConnection.logger.debug(s"$rowAffected row(s) deleted presentation on PresPresentation table")
|
||||
case Failure(e) => DatabaseConnection.logger.error(s"Error deleting presentation on PresPresentation: $e")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user