From 7b7659f1fa9d42410c4431caea2096c30169a718 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:15:12 +0200 Subject: [chore/performance] Further reduce nil uncached queries (#3267) * [chore/performance] Further reduce nil uncached queries * more checks --- internal/db/bundb/relationship_block.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/db/bundb/relationship_block.go') diff --git a/internal/db/bundb/relationship_block.go b/internal/db/bundb/relationship_block.go index 99d77c745..4093bad07 100644 --- a/internal/db/bundb/relationship_block.go +++ b/internal/db/bundb/relationship_block.go @@ -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) -- cgit v1.2.3