Let us retry

This commit is contained in:
Neil Alexander 2022-08-22 12:52:22 +01:00
parent db9ca401b0
commit cd81635cf4
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -1357,7 +1357,11 @@ func (d *Database) ForgetRoom(ctx context.Context, userID, roomID string, forget
func (d *Database) PurgeRoom(ctx context.Context, roomID string) error { func (d *Database) PurgeRoom(ctx context.Context, roomID string) error {
return d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error { return d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error {
roomNID, err := d.RoomsTable.SelectRoomNID(ctx, txn, roomID) roomNID, err := d.RoomsTable.SelectRoomNID(ctx, txn, roomID)
if err != nil { switch err {
case sql.ErrNoRows:
return nil // return nil anyway so we can generate output event for other components
case nil:
default:
return fmt.Errorf("failed to find room NID: %w", err) return fmt.Errorf("failed to find room NID: %w", err)
} }
if err := d.StateBlockTable.PurgeStateBlocks(ctx, txn, roomNID); err != nil { if err := d.StateBlockTable.PurgeStateBlocks(ctx, txn, roomNID); err != nil {