Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Restore old behaviour of PurgeRoom
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK committed Jul 26, 2023
1 parent 7899f47 commit 79d4a0e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion docs/administration/4_adminapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ This endpoint instructs Dendrite to immediately query `/devices/{userID}` on a f

## POST `/_dendrite/admin/purgeRoom/{roomID}`

This endpoint instructs Dendrite to remove the given room from its database. Before doing so, it will evacuate all local users from the room. It does **NOT** remove media files. Depending on the size of the room, this may take a while. Will return an empty JSON once other components were instructed to delete the room.
This endpoint instructs Dendrite to remove the given room from its database. It does **NOT** remove media files. Depending on the size of the room, this may take a while. Will return an empty JSON once other components were instructed to delete the room.

## POST `/_synapse/admin/v1/send_server_notice`

Expand Down
12 changes: 0 additions & 12 deletions roomserver/internal/perform/perform_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,6 @@ func (r *Admin) PerformAdminPurgeRoom(
return err
}

// Evacuate the room before purging it from the database
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")
Expand Down

0 comments on commit 79d4a0e

Please sign in to comment.