summaryrefslogtreecommitdiff
path: root/cmd/gotosocial/admin.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-02-11 12:48:38 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-11 12:48:38 +0100
commit40bc03e71789523ec0f3cc4ae9f8532430832cd4 (patch)
tree9a2baceffea0b80d1701b636eb19107b96e70fd3 /cmd/gotosocial/admin.go
parent[performance] remove throttling timers (#1466) (diff)
downloadgotosocial-0.7.0-rc2.tar.xz
[chore/performance] Update media prune logic, add extra CLI command (#1474)v0.7.0-rc2
* start updating media prune stuff a wee bit * continue prune / uncache work * more tidying + consistency stuff * add prune CLI command * docs * arg
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)