[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

@ -387,6 +387,12 @@ func (r *relationshipDB) DeleteAccountFollowRequests(ctx context.Context, accoun
return err
}
if len(followReqIDs) == 0 {
// Nothing
// to delete.
return nil
}
defer func() {
// Invalidate all account's incoming / outoing follow requests on return.
r.state.Caches.DB.FollowRequest.Invalidate("AccountID", accountID)