diff options
author | Thibault Meyer <0xbaadf00d@users.noreply.github.com> | 2016-08-10 08:47:16 +0200 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-08-09 23:47:16 -0700 |
commit | fc68fb951c179b125b37a83f9e0b5f8dde0478f8 (patch) | |
tree | c96933e6b701293062df7fc8b86cf8eb5db57118 /models | |
parent | 5448d29b2e987c6f37e03c7c5dda01654c50a685 (diff) | |
download | gitea-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 'models')
-rw-r--r-- | models/repo.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go index 92755e9e43..822ad1d9ca 100644 --- a/models/repo.go +++ b/models/repo.go @@ -724,9 +724,9 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) { if opts.IsMirror { if _, err = x.InsertOne(&Mirror{ RepoID: repo.ID, - Interval: 24, + Interval: setting.Mirror.DefaultInterval, EnablePrune: true, - NextUpdate: time.Now().Add(24 * time.Hour), + NextUpdate: time.Now().Add(time.Duration(setting.Mirror.DefaultInterval) * time.Hour), }); err != nil { return repo, fmt.Errorf("InsertOne: %v", err) } |