mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 08:02:26 -05: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
|
|
@ -129,7 +129,7 @@ func (c *controller) NewTransportForUsername(ctx context.Context, username strin
|
|||
u = username
|
||||
}
|
||||
|
||||
ourAccount, err := c.db.GetLocalAccountByUsername(ctx, u)
|
||||
ourAccount, err := c.db.GetAccountByUsernameDomain(ctx, u, "")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting account %s from db: %s", username, err)
|
||||
}
|
||||
|
|
@ -138,6 +138,7 @@ func (c *controller) NewTransportForUsername(ctx context.Context, username strin
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating transport for user %s: %s", username, err)
|
||||
}
|
||||
|
||||
return transport, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue