summaryrefslogtreecommitdiff
path: root/cmd/gotosocial/action/admin/media/prune/orphaned.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/gotosocial/action/admin/media/prune/orphaned.go')
-rw-r--r--cmd/gotosocial/action/admin/media/prune/orphaned.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/gotosocial/action/admin/media/prune/orphaned.go b/cmd/gotosocial/action/admin/media/prune/orphaned.go
index 4ceb356bd..ede00dca2 100644
--- a/cmd/gotosocial/action/admin/media/prune/orphaned.go
+++ b/cmd/gotosocial/action/admin/media/prune/orphaned.go
@@ -27,12 +27,16 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db/bundb"
"github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/media"
+ "github.com/superseriousbusiness/gotosocial/internal/state"
gtsstorage "github.com/superseriousbusiness/gotosocial/internal/storage"
)
// Orphaned prunes orphaned media from storage.
var Orphaned action.GTSAction = func(ctx context.Context) error {
- dbService, err := bundb.NewBunDBService(ctx)
+ var state state.State
+ state.Caches.Init()
+
+ dbService, err := bundb.NewBunDBService(ctx, &state)
if err != nil {
return fmt.Errorf("error creating dbservice: %s", err)
}
@@ -54,7 +58,7 @@ var Orphaned action.GTSAction = func(ctx context.Context) error {
return fmt.Errorf("error pruning: %s", err)
}
- if dry {
+ if dry /* dick heyyoooooo */ {
log.Infof("DRY RUN: %d stored items are orphaned and eligible to be pruned", pruned)
} else {
log.Infof("%d stored items were orphaned and pruned", pruned)