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/instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/processing/instance.go') diff --git a/internal/processing/instance.go b/internal/processing/instance.go index 0a13917ea..b7418659a 100644 --- a/internal/processing/instance.go +++ b/internal/processing/instance.go @@ -137,7 +137,7 @@ func (p *processor) InstancePatch(ctx context.Context, form *apimodel.InstanceSe // validate & update site contact account if it's set on the form if form.ContactUsername != nil { // make sure the account with the given username exists in the db - contactAccount, err := p.db.GetLocalAccountByUsername(ctx, *form.ContactUsername) + contactAccount, err := p.db.GetAccountByUsernameDomain(ctx, *form.ContactUsername, "") if err != nil { return nil, gtserror.NewErrorBadRequest(err, fmt.Sprintf("account with username %s not retrievable", *form.ContactUsername)) } -- cgit v1.2.3