diff options
author | 2023-03-01 18:26:53 +0000 | |
---|---|---|
committer | 2023-03-01 18:26:53 +0000 | |
commit | baf933cb9f3e1053bdb61b90d7027efe9fad1bc2 (patch) | |
tree | 3f2a76851d58517ca3dece2bacd6aceefd8dfb96 /internal/processing/fromfederator.go | |
parent | [feature] Federate pinned posts (aka `featuredCollection`) in and out (#1560) (diff) | |
download | gotosocial-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/fromfederator.go')
-rw-r--r-- | internal/processing/fromfederator.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/processing/fromfederator.go b/internal/processing/fromfederator.go index eea3c529d..afddedf93 100644 --- a/internal/processing/fromfederator.go +++ b/internal/processing/fromfederator.go @@ -139,7 +139,7 @@ func (p *Processor) processCreateStatusFromFederator(ctx context.Context, federa // make sure the account is pinned if status.Account == nil { - a, err := p.db.GetAccountByID(ctx, status.AccountID) + a, err := p.state.DB.GetAccountByID(ctx, status.AccountID) if err != nil { return err } @@ -185,7 +185,7 @@ func (p *Processor) processCreateFaveFromFederator(ctx context.Context, federato // make sure the account is pinned if incomingFave.Account == nil { - a, err := p.db.GetAccountByID(ctx, incomingFave.AccountID) + a, err := p.state.DB.GetAccountByID(ctx, incomingFave.AccountID) if err != nil { return err } @@ -227,7 +227,7 @@ func (p *Processor) processCreateFollowRequestFromFederator(ctx context.Context, // make sure the account is pinned if followRequest.Account == nil { - a, err := p.db.GetAccountByID(ctx, followRequest.AccountID) + a, err := p.state.DB.GetAccountByID(ctx, followRequest.AccountID) if err != nil { return err } @@ -254,7 +254,7 @@ func (p *Processor) processCreateFollowRequestFromFederator(ctx context.Context, } if followRequest.TargetAccount == nil { - a, err := p.db.GetAccountByID(ctx, followRequest.TargetAccountID) + a, err := p.state.DB.GetAccountByID(ctx, followRequest.TargetAccountID) if err != nil { return err } @@ -267,7 +267,7 @@ func (p *Processor) processCreateFollowRequestFromFederator(ctx context.Context, } // if the target account isn't locked, we should already accept the follow and notify about the new follower instead - follow, err := p.db.AcceptFollowRequest(ctx, followRequest.AccountID, followRequest.TargetAccountID) + follow, err := p.state.DB.AcceptFollowRequest(ctx, followRequest.AccountID, followRequest.TargetAccountID) if err != nil { return err } @@ -288,7 +288,7 @@ func (p *Processor) processCreateAnnounceFromFederator(ctx context.Context, fede // make sure the account is pinned if incomingAnnounce.Account == nil { - a, err := p.db.GetAccountByID(ctx, incomingAnnounce.AccountID) + a, err := p.state.DB.GetAccountByID(ctx, incomingAnnounce.AccountID) if err != nil { return err } @@ -324,7 +324,7 @@ func (p *Processor) processCreateAnnounceFromFederator(ctx context.Context, fede } incomingAnnounce.ID = incomingAnnounceID - if err := p.db.PutStatus(ctx, incomingAnnounce); err != nil { + if err := p.state.DB.PutStatus(ctx, incomingAnnounce); err != nil { return fmt.Errorf("error adding dereferenced announce to the db: %s", err) } |