From 614ab12733b991dbea9d1f7fa311a98072558727 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Fri, 2 Sep 2022 10:56:33 +0100 Subject: [performance] use GetAccountByUsernameDomain() for local account lookups to rely on cache (#793) Signed-off-by: kim Signed-off-by: kim --- internal/processing/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/processing/search.go') diff --git a/internal/processing/search.go b/internal/processing/search.go index 2e5ec2025..3d7f3e56e 100644 --- a/internal/processing/search.go +++ b/internal/processing/search.go @@ -193,7 +193,7 @@ func (p *processor) searchAccountByURI(ctx context.Context, authed *oauth.Auth, func (p *processor) searchAccountByMention(ctx context.Context, authed *oauth.Auth, username string, domain string, resolve bool) (*gtsmodel.Account, error) { // if it's a local account we can skip a whole bunch of stuff if domain == config.GetHost() || domain == config.GetAccountDomain() || domain == "" { - maybeAcct, err := p.db.GetLocalAccountByUsername(ctx, username) + maybeAcct, err := p.db.GetAccountByUsernameDomain(ctx, username, "") if err == nil || err == db.ErrNoEntries { return maybeAcct, nil } -- cgit v1.2.3