[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

@ -249,6 +249,12 @@ func (r *relationshipDB) DeleteAccountMutes(ctx context.Context, accountID strin
return err
}
if len(muteIDs) == 0 {
// Nothing
// to delete.
return nil
}
defer func() {
// Invalidate all account's incoming / outoing mutes on return.
r.state.Caches.DB.UserMute.Invalidate("AccountID", accountID)