summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorThibault Meyer <0xbaadf00d@users.noreply.github.com>2016-08-10 08:47:16 +0200
committer无闻 <u@gogs.io>2016-08-09 23:47:16 -0700
commitfc68fb951c179b125b37a83f9e0b5f8dde0478f8 (patch)
treec96933e6b701293062df7fc8b86cf8eb5db57118 /modules
parent5448d29b2e987c6f37e03c7c5dda01654c50a685 (diff)
downloadgitea-fc68fb951c179b125b37a83f9e0b5f8dde0478f8.tar.gz
gitea-fc68fb951c179b125b37a83f9e0b5f8dde0478f8.zip
Feature #3398: Redefine global mirror interval (#3409)
* add mirror::GLOBAL_INTERVAL on app.ini * rename key to DEFAULT_INTERVAL * add key on default app.ini + move code
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/setting.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index a56c4824e9..787e2c81b0 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -208,6 +208,10 @@ var (
} `ini:"git.timeout"`
}
+ Mirror struct {
+ DefaultInterval int
+ }
+
// API settings
API struct {
MaxResponseItems int
@@ -514,6 +518,12 @@ func NewContext() {
log.Fatal(4, "Fail to map Git settings: %v", err)
} else if err = Cfg.Section("api").MapTo(&API); err != nil {
log.Fatal(4, "Fail to map API settings: %v", err)
+ } else if err = Cfg.Section("mirror").MapTo(&Mirror); err != nil {
+ log.Fatal(4, "Fail to map API settings: %v", err)
+ }
+
+ if Mirror.DefaultInterval <= 0 {
+ Mirror.DefaultInterval = 24
}
Langs = Cfg.Section("i18n").Key("LANGS").Strings(",")