mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-26 03:03:31 -06:00
[chore] move PopulateAccountStats() nil check often performed into function itself (#3158)
* move PopulateAccountStats() nil check often performed into function itself * fix test to take in mind we don't repopulate account stats if not-nil
This commit is contained in:
parent
94e87610c4
commit
0f734a2410
8 changed files with 53 additions and 78 deletions
|
|
@ -984,10 +984,8 @@ func (d *Dereferencer) dereferenceAccountStats(
|
|||
account *gtsmodel.Account,
|
||||
) error {
|
||||
// Ensure we have a stats model for this account.
|
||||
if account.Stats == nil {
|
||||
if err := d.state.DB.PopulateAccountStats(ctx, account); err != nil {
|
||||
return gtserror.Newf("db error getting account stats: %w", err)
|
||||
}
|
||||
if err := d.state.DB.PopulateAccountStats(ctx, account); err != nil {
|
||||
return gtserror.Newf("db error getting account stats: %w", err)
|
||||
}
|
||||
|
||||
// We want to update stats by getting remote
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue