summaryrefslogtreecommitdiff
path: root/internal/processing/report/create.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-03-01 18:26:53 +0000
committerLibravatar GitHub <noreply@github.com>2023-03-01 18:26:53 +0000
commitbaf933cb9f3e1053bdb61b90d7027efe9fad1bc2 (patch)
tree3f2a76851d58517ca3dece2bacd6aceefd8dfb96 /internal/processing/report/create.go
parent[feature] Federate pinned posts (aka `featuredCollection`) in and out (#1560) (diff)
downloadgotosocial-baf933cb9f3e1053bdb61b90d7027efe9fad1bc2.tar.xz
[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 <grufwub@gmail.com> Reviewed-by: tobi
Diffstat (limited to 'internal/processing/report/create.go')
-rw-r--r--internal/processing/report/create.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/processing/report/create.go b/internal/processing/report/create.go
index 726d11666..e0918554e 100644
--- a/internal/processing/report/create.go
+++ b/internal/processing/report/create.go
@@ -41,7 +41,7 @@ func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, form
}
// validate + fetch target account
- targetAccount, err := p.db.GetAccountByID(ctx, form.AccountID)
+ targetAccount, err := p.state.DB.GetAccountByID(ctx, form.AccountID)
if err != nil {
if errors.Is(err, db.ErrNoEntries) {
err = fmt.Errorf("account with ID %s does not exist", form.AccountID)
@@ -52,7 +52,7 @@ func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, form
}
// fetch statuses by IDs given in the report form (noop if no statuses given)
- statuses, err := p.db.GetStatuses(ctx, form.StatusIDs)
+ statuses, err := p.state.DB.GetStatuses(ctx, form.StatusIDs)
if err != nil {
err = fmt.Errorf("db error fetching report target statuses: %w", err)
return nil, gtserror.NewErrorInternalError(err)
@@ -79,11 +79,11 @@ func (p *Processor) Create(ctx context.Context, account *gtsmodel.Account, form
Forwarded: &form.Forward,
}
- if err := p.db.PutReport(ctx, report); err != nil {
+ if err := p.state.DB.PutReport(ctx, report); err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
- p.clientWorker.Queue(messages.FromClientAPI{
+ p.state.Workers.EnqueueClientAPI(ctx, messages.FromClientAPI{
APObjectType: ap.ObjectProfile,
APActivityType: ap.ActivityFlag,
GTSModel: report,