Return early if there are no invites to remove

This commit is contained in:
David Robertson 2023-10-11 17:37:24 +01:00
parent 565854d3a7
commit 2375a13af4
No known key found for this signature in database
GPG Key ID: 903ECE108A39DEDD

View File

@ -77,6 +77,10 @@ func (t *InvitesTable) RemoveSupersededInvites(txn *sqlx.Tx, roomID string, newE
}
}
if len(usersToRemove) == 0 {
return nil
}
_, err := txn.Exec(`
DELETE FROM syncv3_invites
WHERE user_id = ANY($1) AND room_id = $2