summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-05-03 11:56:18 +0200
committerLibravatar GitHub <noreply@github.com>2022-05-03 10:56:18 +0100
commitd7b46a4b6377296054cb8facd9b2f9db8fea5bce (patch)
tree02d4d2b14235301a11759409881ffee966670780 /cmd
parent[documentation] Corrects the Helm-Chart URL by 0hlov3 (#530) (diff)
downloadgotosocial-d7b46a4b6377296054cb8facd9b2f9db8fea5bce.tar.xz
[chore] Move initial MediaRemotePrune to cmd.server function (#536)
* move initial prune up to the server start function * don't do initial prune when starting media manager * add admin/mediaremoteprune in processor
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gotosocial/action/server/server.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go
index 8b524d66c..29c05ba1a 100644
--- a/cmd/gotosocial/action/server/server.go
+++ b/cmd/gotosocial/action/server/server.go
@@ -235,6 +235,11 @@ var Start action.GTSAction = func(ctx context.Context) error {
return fmt.Errorf("error starting gotosocial service: %s", err)
}
+ // perform initial media prune in case value of MediaRemoteCacheDays changed
+ if err := processor.AdminMediaRemotePrune(ctx, viper.GetInt(config.Keys.MediaRemoteCacheDays)); err != nil {
+ return fmt.Errorf("error during initial media prune: %s", err)
+ }
+
// catch shutdown signals from the operating system
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, os.Interrupt, syscall.SIGTERM)