From cd81635cf4de1cf7e738777e5eda8b7c13cd3854 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 22 Aug 2022 12:52:22 +0100 Subject: [PATCH] Let us retry --- roomserver/storage/shared/storage.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roomserver/storage/shared/storage.go b/roomserver/storage/shared/storage.go index d1c585440..5c6dce9ea 100644 --- a/roomserver/storage/shared/storage.go +++ b/roomserver/storage/shared/storage.go @@ -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 { return d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error { 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) } if err := d.StateBlockTable.PurgeStateBlocks(ctx, txn, roomNID); err != nil {