summaryrefslogtreecommitdiff
path: root/internal/db/bundb/relationship_follow.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-09-02 18:15:12 +0200
committerLibravatar GitHub <noreply@github.com>2024-09-02 18:15:12 +0200
commit7b7659f1fa9d42410c4431caea2096c30169a718 (patch)
tree81effc23772f822ce3ad54ff63973ebc8cb46a2f /internal/db/bundb/relationship_follow.go
parent[chore] Don't try to select zero uncached filters (#3266) (diff)
downloadgotosocial-7b7659f1fa9d42410c4431caea2096c30169a718.tar.xz
[chore/performance] Further reduce nil uncached queries (#3267)
* [chore/performance] Further reduce nil uncached queries * more checks
Diffstat (limited to 'internal/db/bundb/relationship_follow.go')
-rw-r--r--internal/db/bundb/relationship_follow.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/db/bundb/relationship_follow.go b/internal/db/bundb/relationship_follow.go
index adf3a0161..413f3a2af 100644
--- a/internal/db/bundb/relationship_follow.go
+++ b/internal/db/bundb/relationship_follow.go
@@ -351,6 +351,12 @@ func (r *relationshipDB) DeleteAccountFollows(ctx context.Context, accountID str
return err
}
+ if len(followIDs) == 0 {
+ // Nothing
+ // to delete.
+ return nil
+ }
+
defer func() {
// Invalidate all account's incoming / outoing follows on return.
r.state.Caches.DB.Follow.Invalidate("AccountID", accountID)