[performance] add caching of status fave, boost of, in reply to ID lists (#2060)

This commit is contained in:
kim
2023-08-04 12:28:33 +01:00
committed by GitHub
parent 00adf18c24
commit 9a291dea84
27 changed files with 610 additions and 406 deletions

View File

@ -40,13 +40,13 @@ func (c *converter) interactionsWithStatusForAccount(ctx context.Context, s *gts
si := &statusInteractions{}
if requestingAccount != nil {
faved, err := c.db.IsStatusFavedBy(ctx, s, requestingAccount.ID)
faved, err := c.db.IsStatusFavedBy(ctx, s.ID, requestingAccount.ID)
if err != nil {
return nil, fmt.Errorf("error checking if requesting account has faved status: %s", err)
}
si.Faved = faved
reblogged, err := c.db.IsStatusRebloggedBy(ctx, s, requestingAccount.ID)
reblogged, err := c.db.IsStatusBoostedBy(ctx, s.ID, requestingAccount.ID)
if err != nil {
return nil, fmt.Errorf("error checking if requesting account has reblogged status: %s", err)
}