mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-26 02:53:32 -06:00
[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
This commit is contained in:
parent
141107bdc1
commit
d7b46a4b63
6 changed files with 57 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue