diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-12 22:30:00 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-12 22:30:00 -0400 |
commit | c9a1eb4789d5142090d4936e19ac36b6c2010bd3 (patch) | |
tree | f1a6494a26522f85f67690ba176e2e48ef98b9d4 /routers | |
parent | 52b4ab2aa589cf892b24e95872cbac7b6e78ed3a (diff) | |
download | gitea-c9a1eb4789d5142090d4936e19ac36b6c2010bd3.tar.gz gitea-c9a1eb4789d5142090d4936e19ac36b6c2010bd3.zip |
Able to change mirror interval now
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/repo.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 3b20731c62..dda26899d0 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -336,6 +336,8 @@ func SettingPost(ctx *middleware.Context) { return } + ctx.Data["IsRepoToolbarSetting"] = true + switch ctx.Query("action") { case "update": newRepoName := ctx.Query("name") @@ -371,6 +373,18 @@ func SettingPost(ctx *middleware.Context) { } log.Trace("%s Repository updated: %s/%s", ctx.Req.RequestURI, ctx.Repo.Owner.Name, ctx.Repo.Repository.Name) + if ctx.Repo.Repository.IsMirror { + if len(ctx.Query("interval")) > 0 { + var err error + ctx.Repo.Mirror.Interval, err = base.StrTo(ctx.Query("interval")).Int() + if err != nil { + log.Error("repo.SettingPost(get mirror interval): %v", err) + } else if err = models.UpdateMirror(ctx.Repo.Mirror); err != nil { + log.Error("repo.SettingPost(UpdateMirror): %v", err) + } + } + } + ctx.Flash.Success("Repository options has been successfully updated.") ctx.Redirect(fmt.Sprintf("/%s/%s/settings", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name)) case "transfer": |