mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
parent
11b557097c
commit
f956a8c1d9
46 changed files with 447 additions and 855 deletions
|
@ -136,7 +136,7 @@ func (r *Admin) PerformAdminEvacuateRoom(
|
|||
|
||||
inputReq := &api.InputRoomEventsRequest{
|
||||
InputRoomEvents: inputEvents,
|
||||
Asynchronous: true,
|
||||
Asynchronous: false,
|
||||
}
|
||||
inputRes := &api.InputRoomEventsResponse{}
|
||||
r.Inputer.InputRoomEvents(ctx, inputReq, inputRes)
|
||||
|
@ -200,18 +200,24 @@ func (r *Admin) PerformAdminPurgeRoom(
|
|||
}
|
||||
|
||||
// Evacuate the room before purging it from the database
|
||||
if _, err := r.PerformAdminEvacuateRoom(ctx, roomID); err != nil {
|
||||
evacAffected, err := r.PerformAdminEvacuateRoom(ctx, roomID)
|
||||
if err != nil {
|
||||
logrus.WithField("room_id", roomID).WithError(err).Warn("Failed to evacuate room before purging")
|
||||
return err
|
||||
}
|
||||
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"room_id": roomID,
|
||||
"evacuated_users": len(evacAffected),
|
||||
}).Warn("Evacuated room, purging room from roomserver now")
|
||||
|
||||
logrus.WithField("room_id", roomID).Warn("Purging room from roomserver")
|
||||
if err := r.DB.PurgeRoom(ctx, roomID); err != nil {
|
||||
logrus.WithField("room_id", roomID).WithError(err).Warn("Failed to purge room from roomserver")
|
||||
return err
|
||||
}
|
||||
|
||||
logrus.WithField("room_id", roomID).Warn("Room purged from roomserver")
|
||||
logrus.WithField("room_id", roomID).Warn("Room purged from roomserver, informing other components")
|
||||
|
||||
return r.Inputer.OutputProducer.ProduceRoomEvents(roomID, []api.OutputEvent{
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue