[performance] use GetAccountByUsernameDomain() for local account lookups to rely on cache (#793)

Signed-off-by: kim <grufwub@gmail.com>

Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
kim
2022-09-02 10:56:33 +01:00
committed by GitHub
parent 1e1cdee06a
commit 614ab12733
19 changed files with 29 additions and 42 deletions

View File

@ -31,7 +31,7 @@ import (
func (p *processor) GetOutbox(ctx context.Context, requestedUsername string, page bool, maxID string, minID string, requestURL *url.URL) (interface{}, gtserror.WithCode) {
// get the account the request is referring to
requestedAccount, err := p.db.GetLocalAccountByUsername(ctx, requestedUsername)
requestedAccount, err := p.db.GetAccountByUsernameDomain(ctx, requestedUsername, "")
if err != nil {
return nil, gtserror.NewErrorNotFound(fmt.Errorf("database error getting account with username %s: %s", requestedUsername, err))
}