aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2017-10-26 02:49:16 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-10-26 08:49:16 +0800
commit3ab580c8d6b8a2c063d848f8e3002347c9e5cebb (patch)
tree3f66f793be25db1ca8baac8d5333e39bfdd4f7e1 /modules
parente86a0bf3feab82c1b3439806245083dffb2f37c9 (diff)
downloadgitea-3ab580c8d6b8a2c063d848f8e3002347c9e5cebb.tar.gz
gitea-3ab580c8d6b8a2c063d848f8e3002347c9e5cebb.zip
Add branch overiew page (#2108)
* Add branch overiew page * fix changed method name on sub menu * remove unused code
Diffstat (limited to 'modules')
-rw-r--r--modules/cron/cron.go11
-rw-r--r--modules/setting/setting.go17
2 files changed, 28 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()
}
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 7706ee3e95..9787e09280 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -365,6 +365,12 @@ var (
Schedule string
UpdateExisting bool
} `ini:"cron.sync_external_users"`
+ DeletedBranchesCleanup struct {
+ Enabled bool
+ RunAtStart bool
+ Schedule string
+ OlderThan time.Duration
+ } `ini:"cron.deleted_branches_cleanup"`
}{
UpdateMirror: struct {
Enabled bool
@@ -419,6 +425,17 @@ var (
Schedule: "@every 24h",
UpdateExisting: true,
},
+ DeletedBranchesCleanup: struct {
+ Enabled bool
+ RunAtStart bool
+ Schedule string
+ OlderThan time.Duration
+ }{
+ Enabled: true,
+ RunAtStart: true,
+ Schedule: "@every 24h",
+ OlderThan: 24 * time.Hour,
+ },
}
// Git settings