diff options
Diffstat (limited to 'modules/cron')
-rw-r--r-- | modules/cron/cron.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/cron/cron.go b/modules/cron/cron.go index e1110d787b..785bf44ada 100644 --- a/modules/cron/cron.go +++ b/modules/cron/cron.go @@ -55,6 +55,17 @@ func NewContext() { go models.CheckRepoStats() } } + if setting.Cron.ArchiveCleanup.Enabled { + entry, err = c.AddFunc("Clean up old repository archives", setting.Cron.ArchiveCleanup.Schedule, models.DeleteOldRepositoryArchives) + if err != nil { + log.Fatal(4, "Cron[Clean up old repository archives]: %v", err) + } + if setting.Cron.ArchiveCleanup.RunAtStart { + entry.Prev = time.Now() + entry.ExecTimes++ + go models.DeleteOldRepositoryArchives() + } + } c.Start() } |