diff options
author | 2023-03-01 18:26:53 +0000 | |
---|---|---|
committer | 2023-03-01 18:26:53 +0000 | |
commit | baf933cb9f3e1053bdb61b90d7027efe9fad1bc2 (patch) | |
tree | 3f2a76851d58517ca3dece2bacd6aceefd8dfb96 /internal/federation/federatingdb/db.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/federation/federatingdb/db.go')
-rw-r--r-- | internal/federation/federatingdb/db.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/internal/federation/federatingdb/db.go b/internal/federation/federatingdb/db.go index 24455a553..af4aceeeb 100644 --- a/internal/federation/federatingdb/db.go +++ b/internal/federation/federatingdb/db.go @@ -24,9 +24,7 @@ import ( "codeberg.org/gruf/go-mutexes" "github.com/superseriousbusiness/activity/pub" "github.com/superseriousbusiness/activity/streams/vocab" - "github.com/superseriousbusiness/gotosocial/internal/concurrency" - "github.com/superseriousbusiness/gotosocial/internal/db" - "github.com/superseriousbusiness/gotosocial/internal/messages" + "github.com/superseriousbusiness/gotosocial/internal/state" "github.com/superseriousbusiness/gotosocial/internal/typeutils" ) @@ -43,17 +41,15 @@ type DB interface { // It doesn't care what the underlying implementation of the DB interface is, as long as it works. type federatingDB struct { locks mutexes.MutexMap - db db.DB - fedWorker *concurrency.WorkerPool[messages.FromFederator] + state *state.State typeConverter typeutils.TypeConverter } // New returns a DB interface using the given database and config -func New(db db.DB, fedWorker *concurrency.WorkerPool[messages.FromFederator], tc typeutils.TypeConverter) DB { +func New(state *state.State, tc typeutils.TypeConverter) DB { fdb := federatingDB{ locks: mutexes.NewMap(-1, -1), // use defaults - db: db, - fedWorker: fedWorker, + state: state, typeConverter: tc, } return &fdb |