diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-30 02:26:29 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-30 02:26:29 -0500 |
commit | d75013a0e88a1f46fd16f5ba9344ff17ed84cd37 (patch) | |
tree | c153e256f1608c219e4717e3fab217c8aec1187b /modules | |
parent | b6437b5a4c52bceb8032b00b474c2aa0ced69575 (diff) | |
download | gitea-d75013a0e88a1f46fd16f5ba9344ff17ed84cd37.tar.gz gitea-d75013a0e88a1f46fd16f5ba9344ff17ed84cd37.zip |
fix #580
Diffstat (limited to 'modules')
-rw-r--r-- | modules/cron/manager.go | 2 | ||||
-rw-r--r-- | modules/setting/setting.go | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/modules/cron/manager.go b/modules/cron/manager.go index 563426fb79..fcf559bcb0 100644 --- a/modules/cron/manager.go +++ b/modules/cron/manager.go @@ -14,8 +14,10 @@ import ( var c = New() func NewCronContext() { + models.GitFsck() c.AddFunc("Update mirrors", "@every 1h", models.MirrorUpdate) c.AddFunc("Deliver hooks", fmt.Sprintf("@every %dm", setting.WebhookTaskInterval), models.DeliverHooks) + c.AddFunc("Repository health check", "@every 1h", models.GitFsck) c.Start() } diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 9737fa7c1d..476fc6affa 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -109,6 +109,8 @@ var ( // Git settings. MaxGitDiffLines int + GitFsckArgs []string + GitGcArgs []string // I18n settings. Langs, Names []string @@ -288,6 +290,8 @@ func NewConfigContext() { DisableGravatar = Cfg.MustBool("picture", "DISABLE_GRAVATAR") MaxGitDiffLines = Cfg.MustInt("git", "MAX_GITDIFF_LINES", 10000) + GitFsckArgs = Cfg.MustValueArray("git", "FSCK_ARGS", " ") + GitGcArgs = Cfg.MustValueArray("git", "GC_ARGS", " ") Langs = Cfg.MustValueArray("i18n", "LANGS", ",") Names = Cfg.MustValueArray("i18n", "NAMES", ",") |