summaryrefslogtreecommitdiff
path: root/cmd/gotosocial/action/admin/media/prune/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/gotosocial/action/admin/media/prune/common.go')
-rw-r--r--cmd/gotosocial/action/admin/media/prune/common.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/gotosocial/action/admin/media/prune/common.go b/cmd/gotosocial/action/admin/media/prune/common.go
index 54144504c..f6a782c69 100644
--- a/cmd/gotosocial/action/admin/media/prune/common.go
+++ b/cmd/gotosocial/action/admin/media/prune/common.go
@@ -37,7 +37,10 @@ type prune struct {
func setupPrune(ctx context.Context) (*prune, error) {
var state state.State
+
state.Caches.Init()
+ state.Caches.Start()
+
state.Workers.Start()
dbService, err := bundb.NewBunDBService(ctx, &state)
@@ -51,8 +54,6 @@ func setupPrune(ctx context.Context) (*prune, error) {
if err != nil {
return nil, fmt.Errorf("error creating storage backend: %w", err)
}
-
- state.DB = dbService
state.Storage = storage
//nolint:contextcheck
@@ -75,8 +76,8 @@ func (p *prune) shutdown(ctx context.Context) error {
return fmt.Errorf("error closing dbservice: %w", err)
}
- p.state.Caches.Stop()
p.state.Workers.Stop()
+ p.state.Caches.Stop()
return nil
}