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/status/create.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/processing/status/create.go') diff --git a/internal/processing/status/create.go b/internal/processing/status/create.go index f47c850dd..4e5399469 100644 --- a/internal/processing/status/create.go +++ b/internal/processing/status/create.go @@ -61,11 +61,11 @@ func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, appli Text: form.Status, } - if errWithCode := processReplyToID(ctx, p.db, form, account.ID, newStatus); errWithCode != nil { + if errWithCode := processReplyToID(ctx, p.state.DB, form, account.ID, newStatus); errWithCode != nil { return nil, errWithCode } - if errWithCode := processMediaIDs(ctx, p.db, form, account.ID, newStatus); errWithCode != nil { + if errWithCode := processMediaIDs(ctx, p.state.DB, form, account.ID, newStatus); errWithCode != nil { return nil, errWithCode } @@ -77,17 +77,17 @@ func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, appli return nil, gtserror.NewErrorInternalError(err) } - if err := processContent(ctx, p.db, p.formatter, p.parseMention, form, account.ID, newStatus); err != nil { + if err := processContent(ctx, p.state.DB, p.formatter, p.parseMention, form, account.ID, newStatus); err != nil { return nil, gtserror.NewErrorInternalError(err) } // put the new status in the database - if err := p.db.PutStatus(ctx, newStatus); err != nil { + if err := p.state.DB.PutStatus(ctx, newStatus); err != nil { return nil, gtserror.NewErrorInternalError(err) } // send it back to the processor for async processing - p.clientWorker.Queue(messages.FromClientAPI{ + p.state.Workers.EnqueueClientAPI(ctx, messages.FromClientAPI{ APObjectType: ap.ObjectNote, APActivityType: ap.ActivityCreate, GTSModel: newStatus, -- cgit v1.2.3