mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-27 17:13:31 -06:00
[performance] don't use relations to select notification structs, use caches instead (#1072)
This commit is contained in:
parent
91c3489d5f
commit
d98a48b446
3 changed files with 5 additions and 11 deletions
|
|
@ -55,9 +55,6 @@ func (n *notificationDB) GetNotification(ctx context.Context, id string) (*gtsmo
|
|||
|
||||
q := n.conn.NewSelect().
|
||||
Model(¬if).
|
||||
Relation("OriginAccount").
|
||||
Relation("TargetAccount").
|
||||
Relation("Status").
|
||||
Where("? = ?", bun.Ident("notification.id"), id)
|
||||
if err := q.Scan(ctx); err != nil {
|
||||
return nil, n.conn.ProcessError(err)
|
||||
|
|
|
|||
|
|
@ -113,9 +113,6 @@ func (suite *NotificationTestSuite) TestGetNotificationsWithoutSpam() {
|
|||
suite.NotNil(notifications)
|
||||
for _, n := range notifications {
|
||||
suite.Equal(testAccount.ID, n.TargetAccountID)
|
||||
suite.NotNil(n.OriginAccount)
|
||||
suite.NotNil(n.TargetAccount)
|
||||
suite.NotNil(n.Status)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue