mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 22:42:27 -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
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue