diff options
author | 2021-06-13 18:42:28 +0200 | |
---|---|---|
committer | 2021-06-13 18:42:28 +0200 | |
commit | b4288f3c47a9ff9254b933dcb9ee7274d4a4135c (patch) | |
tree | 3fe1bb1ab8d4b8c5d9a83df708e5088f35c3150a /internal/cliactions/server/server.go | |
parent | Tidy + timeline embetterment (#38) (diff) | |
download | gotosocial-b4288f3c47a9ff9254b933dcb9ee7274d4a4135c.tar.xz |
Timeline manager (#40)
* start messing about with timeline manager
* i have no idea what i'm doing
* i continue to not know what i'm doing
* it's coming along
* bit more progress
* update timeline with new posts as they come in
* lint and fmt
* Select accounts where empty string
* restructure a bunch, get unfaves working
* moving stuff around
* federate status deletes properly
* mention regex better but not 100% there
* fix regex
* some more hacking away at the timeline code phew
* fix up some little things
* i can't even
* more timeline stuff
* move to ulid
* fiddley
* some lil fixes for kibou compatibility
* timelines working pretty alright!
* tidy + lint
Diffstat (limited to 'internal/cliactions/server/server.go')
-rw-r--r-- | internal/cliactions/server/server.go | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/internal/cliactions/server/server.go b/internal/cliactions/server/server.go index bfb2751ce..f0558909d 100644 --- a/internal/cliactions/server/server.go +++ b/internal/cliactions/server/server.go @@ -40,6 +40,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/oauth" "github.com/superseriousbusiness/gotosocial/internal/processing" "github.com/superseriousbusiness/gotosocial/internal/router" + timelineprocessing "github.com/superseriousbusiness/gotosocial/internal/timeline" "github.com/superseriousbusiness/gotosocial/internal/transport" "github.com/superseriousbusiness/gotosocial/internal/typeutils" ) @@ -74,6 +75,20 @@ var Start cliactions.GTSAction = func(ctx context.Context, c *config.Config, log return fmt.Errorf("error creating dbservice: %s", err) } + for _, m := range models { + if err := dbService.CreateTable(m); err != nil { + return fmt.Errorf("table creation error: %s", err) + } + } + + if err := dbService.CreateInstanceAccount(); err != nil { + return fmt.Errorf("error creating instance account: %s", err) + } + + if err := dbService.CreateInstanceInstance(); err != nil { + return fmt.Errorf("error creating instance instance: %s", err) + } + federatingDB := federatingdb.New(dbService, c, log) router, err := router.New(c, log) @@ -88,13 +103,14 @@ var Start cliactions.GTSAction = func(ctx context.Context, c *config.Config, log // build converters and util typeConverter := typeutils.NewConverter(c, dbService) + timelineManager := timelineprocessing.NewManager(dbService, typeConverter, c, log) // build backend handlers mediaHandler := media.New(c, dbService, storageBackend, log) oauthServer := oauth.New(dbService, log) transportController := transport.NewController(c, &federation.Clock{}, http.DefaultClient, log) federator := federation.NewFederator(dbService, federatingDB, transportController, c, log, typeConverter) - processor := processing.NewProcessor(c, typeConverter, federator, oauthServer, mediaHandler, storageBackend, dbService, log) + processor := processing.NewProcessor(c, typeConverter, federator, oauthServer, mediaHandler, storageBackend, timelineManager, dbService, log) if err := processor.Start(); err != nil { return fmt.Errorf("error starting processor: %s", err) } @@ -149,20 +165,6 @@ var Start cliactions.GTSAction = func(ctx context.Context, c *config.Config, log } } - for _, m := range models { - if err := dbService.CreateTable(m); err != nil { - return fmt.Errorf("table creation error: %s", err) - } - } - - if err := dbService.CreateInstanceAccount(); err != nil { - return fmt.Errorf("error creating instance account: %s", err) - } - - if err := dbService.CreateInstanceInstance(); err != nil { - return fmt.Errorf("error creating instance instance: %s", err) - } - gts, err := gotosocial.NewServer(dbService, router, federator, c) if err != nil { return fmt.Errorf("error creating gotosocial service: %s", err) |