mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 12:52:27 -05:00
[feature] Add admin media prune orphaned CLI command (#1146)
* add FilePath regex * add `admin media prune orphaned` command * add prune orphaned function to media manager * don't mark flag as required * document admin media prune orphaned cmd * oh envparsing.sh you coy minx
This commit is contained in:
parent
9e18c7f996
commit
13e9abd02a
11 changed files with 441 additions and 45 deletions
|
|
@ -91,6 +91,12 @@ type Manager interface {
|
|||
//
|
||||
// The returned int is the amount of media that was pruned by this function.
|
||||
PruneUnusedLocalAttachments(ctx context.Context) (int, error)
|
||||
// PruneOrphaned prunes files that exist in storage but which do not have a corresponding
|
||||
// entry in the database.
|
||||
//
|
||||
// If dry is true, then nothing will be changed, only the amount that *would* be removed
|
||||
// is returned to the caller.
|
||||
PruneOrphaned(ctx context.Context, dry bool) (int, error)
|
||||
|
||||
// Stop stops the underlying worker pool of the manager. It should be called
|
||||
// when closing GoToSocial in order to cleanly finish any in-progress jobs.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue