summaryrefslogtreecommitdiff
path: root/cmd/gotosocial/admin.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/gotosocial/admin.go')
-rw-r--r--cmd/gotosocial/admin.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/cmd/gotosocial/admin.go b/cmd/gotosocial/admin.go
index da170fccd..b28d39251 100644
--- a/cmd/gotosocial/admin.go
+++ b/cmd/gotosocial/admin.go
@@ -169,7 +169,6 @@ func adminCommands() *cobra.Command {
Use: "prune",
Short: "admin commands for pruning unused/orphaned media from storage",
}
- config.AddAdminMediaPrune(adminMediaPruneCmd)
adminMediaPruneOrphanedCmd := &cobra.Command{
Use: "orphaned",
@@ -184,6 +183,19 @@ func adminCommands() *cobra.Command {
config.AddAdminMediaPrune(adminMediaPruneOrphanedCmd)
adminMediaPruneCmd.AddCommand(adminMediaPruneOrphanedCmd)
+ adminMediaPruneRemoteCmd := &cobra.Command{
+ Use: "remote",
+ Short: "prune unused/stale remote media from storage, older than given number of days",
+ PreRunE: func(cmd *cobra.Command, args []string) error {
+ return preRun(preRunArgs{cmd: cmd})
+ },
+ RunE: func(cmd *cobra.Command, args []string) error {
+ return run(cmd.Context(), prune.Remote)
+ },
+ }
+ config.AddAdminMediaPrune(adminMediaPruneRemoteCmd)
+ adminMediaPruneCmd.AddCommand(adminMediaPruneRemoteCmd)
+
adminMediaCmd.AddCommand(adminMediaPruneCmd)
adminCmd.AddCommand(adminMediaCmd)