From baf933cb9f3e1053bdb61b90d7027efe9fad1bc2 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:26:53 +0000 Subject: [chore] move client/federator workerpools to Workers{} (#1575) * replace concurrency worker pools with base models in State.Workers, update code and tests accordingly * improve code comment * change back testrig default log level * un-comment-out TestAnnounceTwice() and fix --------- Signed-off-by: kim Reviewed-by: tobi --- internal/processing/account/rss.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/processing/account/rss.go') diff --git a/internal/processing/account/rss.go b/internal/processing/account/rss.go index 22065cf8e..61fcc1c51 100644 --- a/internal/processing/account/rss.go +++ b/internal/processing/account/rss.go @@ -34,7 +34,7 @@ const rssFeedLength = 20 // GetRSSFeedForUsername returns RSS feed for the given local username. func (p *Processor) GetRSSFeedForUsername(ctx context.Context, username string) (func() (string, gtserror.WithCode), time.Time, gtserror.WithCode) { - account, err := p.db.GetAccountByUsernameDomain(ctx, username, "") + account, err := p.state.DB.GetAccountByUsernameDomain(ctx, username, "") if err != nil { if err == db.ErrNoEntries { return nil, time.Time{}, gtserror.NewErrorNotFound(errors.New("GetRSSFeedForUsername: account not found")) @@ -46,13 +46,13 @@ func (p *Processor) GetRSSFeedForUsername(ctx context.Context, username string) return nil, time.Time{}, gtserror.NewErrorNotFound(errors.New("GetRSSFeedForUsername: account RSS feed not enabled")) } - lastModified, err := p.db.GetAccountLastPosted(ctx, account.ID, true) + lastModified, err := p.state.DB.GetAccountLastPosted(ctx, account.ID, true) if err != nil { return nil, time.Time{}, gtserror.NewErrorInternalError(fmt.Errorf("GetRSSFeedForUsername: db error: %s", err)) } return func() (string, gtserror.WithCode) { - statuses, err := p.db.GetAccountWebStatuses(ctx, account.ID, rssFeedLength, "") + statuses, err := p.state.DB.GetAccountWebStatuses(ctx, account.ID, rssFeedLength, "") if err != nil && err != db.ErrNoEntries { return "", gtserror.NewErrorInternalError(fmt.Errorf("GetRSSFeedForUsername: db error: %s", err)) } @@ -65,7 +65,7 @@ func (p *Processor) GetRSSFeedForUsername(ctx context.Context, username string) var image *feeds.Image if account.AvatarMediaAttachmentID != "" { if account.AvatarMediaAttachment == nil { - avatar, err := p.db.GetAttachmentByID(ctx, account.AvatarMediaAttachmentID) + avatar, err := p.state.DB.GetAttachmentByID(ctx, account.AvatarMediaAttachmentID) if err != nil { return "", gtserror.NewErrorInternalError(fmt.Errorf("GetRSSFeedForUsername: db error fetching avatar attachment: %s", err)) } -- cgit v1.2.3