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/account/account.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/account/account.go')
-rw-r--r-- | internal/processing/account/account.go | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/internal/processing/account/account.go b/internal/processing/account/account.go index 41315d483..62330c0dc 100644 --- a/internal/processing/account/account.go +++ b/internal/processing/account/account.go @@ -19,13 +19,11 @@ package account import ( - "github.com/superseriousbusiness/gotosocial/internal/concurrency" - "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/federation" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/media" - "github.com/superseriousbusiness/gotosocial/internal/messages" "github.com/superseriousbusiness/gotosocial/internal/oauth" + "github.com/superseriousbusiness/gotosocial/internal/state" "github.com/superseriousbusiness/gotosocial/internal/text" "github.com/superseriousbusiness/gotosocial/internal/typeutils" "github.com/superseriousbusiness/gotosocial/internal/visibility" @@ -35,35 +33,32 @@ import ( // // It also contains logic for actions towards accounts such as following, blocking, seeing follows, etc. type Processor struct { + state *state.State tc typeutils.TypeConverter mediaManager media.Manager - clientWorker *concurrency.WorkerPool[messages.FromClientAPI] oauthServer oauth.Server filter visibility.Filter formatter text.Formatter - db db.DB federator federation.Federator parseMention gtsmodel.ParseMentionFunc } // New returns a new account processor. func New( - db db.DB, + state *state.State, tc typeutils.TypeConverter, mediaManager media.Manager, oauthServer oauth.Server, - clientWorker *concurrency.WorkerPool[messages.FromClientAPI], federator federation.Federator, parseMention gtsmodel.ParseMentionFunc, ) Processor { return Processor{ + state: state, tc: tc, mediaManager: mediaManager, - clientWorker: clientWorker, oauthServer: oauthServer, - filter: visibility.NewFilter(db), - formatter: text.NewFormatter(db), - db: db, + filter: visibility.NewFilter(state.DB), + formatter: text.NewFormatter(state.DB), federator: federator, parseMention: parseMention, } |