diff options
Diffstat (limited to 'modules/cron/cron.go')
-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 a64b51253c..ede73e0666 100644 --- a/modules/cron/cron.go +++ b/modules/cron/cron.go @@ -77,6 +77,17 @@ func NewContext() { go models.SyncExternalUsers() } } + if setting.Cron.DeletedBranchesCleanup.Enabled { + entry, err = c.AddFunc("Remove old deleted branches", setting.Cron.DeletedBranchesCleanup.Schedule, models.RemoveOldDeletedBranches) + if err != nil { + log.Fatal(4, "Cron[Remove old deleted branches]: %v", err) + } + if setting.Cron.DeletedBranchesCleanup.RunAtStart { + entry.Prev = time.Now() + entry.ExecTimes++ + go models.RemoveOldDeletedBranches() + } + } c.Start() } |