From 1edcb06afe05b16ba49b67be2f449af9061a184c Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 1 May 2024 13:55:00 +0200 Subject: [PATCH] [bugfix] Tidy up remaining references to workers in cmd (#2889) --- cmd/gotosocial/action/admin/account/account.go | 1 - cmd/gotosocial/action/admin/media/list.go | 3 --- cmd/gotosocial/action/admin/media/prune/common.go | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/gotosocial/action/admin/account/account.go b/cmd/gotosocial/action/admin/account/account.go index 0693dd04e..57d0d3805 100644 --- a/cmd/gotosocial/action/admin/account/account.go +++ b/cmd/gotosocial/action/admin/account/account.go @@ -52,7 +52,6 @@ func initState(ctx context.Context) (*state.State, error) { func stopState(state *state.State) error { err := state.DB.Close() - state.Workers.Stop() state.Caches.Stop() return err } diff --git a/cmd/gotosocial/action/admin/media/list.go b/cmd/gotosocial/action/admin/media/list.go index ed10c967a..9791a9f51 100644 --- a/cmd/gotosocial/action/admin/media/list.go +++ b/cmd/gotosocial/action/admin/media/list.go @@ -127,8 +127,6 @@ func setupList(ctx context.Context) (*list, error) { state.Caches.Init() state.Caches.Start() - state.Workers.Start() - dbService, err := bundb.NewBunDBService(ctx, &state) if err != nil { return nil, fmt.Errorf("error creating dbservice: %w", err) @@ -148,7 +146,6 @@ func setupList(ctx context.Context) (*list, error) { func (l *list) shutdown() error { l.out.Flush() err := l.dbService.Close() - l.state.Workers.Stop() l.state.Caches.Stop() return err } diff --git a/cmd/gotosocial/action/admin/media/prune/common.go b/cmd/gotosocial/action/admin/media/prune/common.go index fcdb2bcf2..292b4a18b 100644 --- a/cmd/gotosocial/action/admin/media/prune/common.go +++ b/cmd/gotosocial/action/admin/media/prune/common.go @@ -88,7 +88,7 @@ func (p *prune) shutdown() error { errs.Appendf("error stopping database: %w", err) } - p.state.Workers.Stop() + p.state.Workers.Scheduler.Stop() p.state.Caches.Stop() return errs.Combine()