mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-04 23:38:08 -06:00
[chore/performance] Further reduce nil uncached queries (#3267)
* [chore/performance] Further reduce nil uncached queries * more checks
This commit is contained in:
parent
0560c5ce89
commit
7b7659f1fa
8 changed files with 62 additions and 13 deletions
|
|
@ -313,7 +313,14 @@ func (c *conversationDB) DeleteConversationsByOwnerAccountID(ctx context.Context
|
|||
return gtserror.Newf("error deleting conversations for account %s: %w", accountID, err)
|
||||
}
|
||||
|
||||
// Delete any conversation-to-status links matching the deleted conversation IDs.
|
||||
if len(deletedConversationIDs) == 0 {
|
||||
// Nothing
|
||||
// to delete.
|
||||
return nil
|
||||
}
|
||||
|
||||
// Delete any conversation-to-status links
|
||||
// matching the deleted conversation IDs.
|
||||
if _, err := tx.NewDelete().
|
||||
Model((*gtsmodel.ConversationToStatus)(nil)).
|
||||
Where("? IN (?)", bun.Ident("conversation_id"), bun.In(deletedConversationIDs)).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue