summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-18 02:19:29 +0800
committerUnknwon <u@gogs.io>2015-08-18 02:19:29 +0800
commitb1696665bdf0e31c227493cf637d3867e102d131 (patch)
tree4dbd11c8998a8875147cf8e23b3d819d5aee080e /modules/setting
parentd17f102339c8542cfb5e81ab6a705b1b64651f51 (diff)
downloadgitea-b1696665bdf0e31c227493cf637d3867e102d131.tar.gz
gitea-b1696665bdf0e31c227493cf637d3867e102d131.zip
make cron task configurable
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go27
1 files changed, 22 insertions, 5 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index acd3aae689..5c9c634379 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -126,11 +126,26 @@ var (
Git struct {
MaxGitDiffLines int
GcArgs []string `delim:" "`
- Fsck struct {
- Enable bool
- Interval int
- Args []string `delim:" "`
- } `ini:"git.fsck"`
+ }
+
+ // Cron tasks.
+ Cron struct {
+ UpdateMirror struct {
+ Enabled bool
+ RunAtStart bool
+ Schedule string
+ } `ini:"cron.update_mirrors"`
+ RepoHealthCheck struct {
+ Enabled bool
+ RunAtStart bool
+ Schedule string
+ Args []string `delim:" "`
+ } `ini:"cron.repo_health_check"`
+ CheckRepoStats struct {
+ Enabled bool
+ RunAtStart bool
+ Schedule string
+ } `ini:"cron.check_repo_stats"`
}
// I18n settings.
@@ -361,6 +376,8 @@ func NewConfigContext() {
if err = Cfg.Section("git").MapTo(&Git); err != nil {
log.Fatal(4, "Fail to map Git settings: %v", err)
+ } else if Cfg.Section("cron").MapTo(&Cron); err != nil {
+ log.Fatal(4, "Fail to map Cron settings: %v", err)
}
Langs = Cfg.Section("i18n").Key("LANGS").Strings(",")