[chore/performance] Further reduce nil uncached queries (#3267)

* [chore/performance] Further reduce nil uncached queries

* more checks
This commit is contained in:
tobi 2024-09-02 18:15:12 +02:00 committed by GitHub
commit 7b7659f1fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 62 additions and 13 deletions

View file

@ -286,6 +286,12 @@ func (r *relationshipDB) DeleteAccountBlocks(ctx context.Context, accountID stri
return err
}
if len(blockIDs) == 0 {
// Nothing
// to delete.
return nil
}
defer func() {
// Invalidate all account's incoming / outoing blocks on return.
r.state.Caches.DB.Block.Invalidate("AccountID", accountID)