mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02: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:
@@ -70,11 +70,9 @@ func (p *Processor) GetRSSFeedForUsername(ctx context.Context, username string)
|
||||
}
|
||||
|
||||
// Ensure account stats populated.
|
||||
if account.Stats == nil {
|
||||
if err := p.state.DB.PopulateAccountStats(ctx, account); err != nil {
|
||||
err = gtserror.Newf("db error getting account stats %s: %w", username, err)
|
||||
return nil, never, gtserror.NewErrorInternalError(err)
|
||||
}
|
||||
if err := p.state.DB.PopulateAccountStats(ctx, account); err != nil {
|
||||
err = gtserror.Newf("db error getting account stats %s: %w", username, err)
|
||||
return nil, never, gtserror.NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
// LastModified time is needed by callers to check freshness for cacheing.
|
||||
|
Reference in New Issue
Block a user