mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-13 21:07:27 -06:00
[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:
parent
1e1cdee06a
commit
614ab12733
19 changed files with 29 additions and 42 deletions
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue