summaryrefslogtreecommitdiff
path: root/internal/media/manager.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2022-05-03 10:05:22 +0100
committerLibravatar GitHub <noreply@github.com>2022-05-03 11:05:22 +0200
commite09958e7f18a67e42eef4005570f406ea2c72ae6 (patch)
treed81367e4cbf0a28af479c5999afe52b3cdbd483c /internal/media/manager.go
parent[chore] Fix inbox iris test to use 'contains' instead of index (#529) (diff)
downloadgotosocial-e09958e7f18a67e42eef4005570f406ea2c72ae6.tar.xz
[feature] Run initial cache cleanup on gotosocial start in case max-age changed (#533)
Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/media/manager.go')
-rw-r--r--internal/media/manager.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/media/manager.go b/internal/media/manager.go
index 3baab6854..bf1c702c3 100644
--- a/internal/media/manager.go
+++ b/internal/media/manager.go
@@ -109,7 +109,6 @@ type manager struct {
// For a 4 core machine, this will be 2 workers, and a queue length of 20.
// For a single or 2-core machine, the media manager will get 1 worker, and a queue of length 10.
func NewManager(database db.DB, storage *kv.KVStore) (Manager, error) {
-
// configure the worker pool
// make sure we always have at least 1 worker even on single-core machines
numWorkers := runtime.NumCPU() / 2
@@ -176,9 +175,13 @@ func NewManager(database db.DB, storage *kv.KVStore) (Manager, error) {
return nil
}
+ // Run an initial cache prune in case max age changed
+ logrus.Infof("media manager: running initial remote cache cleanup")
+ go pruneFunc()
+
// now start all the cron stuff we've lined up
c.Start()
- logrus.Infof("started media manager remote cache cleanup job: will run next at %s", c.Entry(entryID).Next)
+ logrus.Infof("media manager: next scheduled remote cache cleanup is %q", c.Entry(entryID).Next)
}
return m, nil