mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 12:52:27 -05:00
[feature/chore] Add Move database functions + cache (#2647)
* [feature/chore] Add Move database functions + cache * add move mem ratio to envparsing.sh * update comment
This commit is contained in:
parent
61a2b91f45
commit
b22e213e15
17 changed files with 671 additions and 1 deletions
|
|
@ -304,6 +304,17 @@ func (a *accountDB) PopulateAccount(ctx context.Context, account *gtsmodel.Accou
|
|||
account.AlsoKnownAs = alsoKnownAs
|
||||
}
|
||||
|
||||
if account.Move == nil && account.MoveID != "" {
|
||||
// Account move is not set, fetch from database.
|
||||
account.Move, err = a.state.DB.GetMoveByID(
|
||||
ctx,
|
||||
account.MovedToURI,
|
||||
)
|
||||
if err != nil {
|
||||
errs.Appendf("error populating move: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if account.MovedTo == nil && account.MovedToURI != "" {
|
||||
// Account movedTo is not set, fetch from database.
|
||||
account.MovedTo, err = a.state.DB.GetAccountByURI(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue