mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-24 03:21:49 +01:00
Fix #223
This commit is contained in:
parent
32c5fa514c
commit
9c3aa6936a
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,7 @@ package repo
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/go-martini/martini"
|
"github.com/go-martini/martini"
|
||||||
|
|
||||||
|
@ -72,6 +73,7 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||||
if ctx.Repo.Repository.IsMirror {
|
if ctx.Repo.Repository.IsMirror {
|
||||||
if form.Interval > 0 {
|
if form.Interval > 0 {
|
||||||
ctx.Repo.Mirror.Interval = form.Interval
|
ctx.Repo.Mirror.Interval = form.Interval
|
||||||
|
ctx.Repo.Mirror.NextUpdate = time.Now().Add(time.Duration(form.Interval) * time.Hour)
|
||||||
if err := models.UpdateMirror(ctx.Repo.Mirror); err != nil {
|
if err := models.UpdateMirror(ctx.Repo.Mirror); err != nil {
|
||||||
log.Error("setting.SettingPost(UpdateMirror): %v", err)
|
log.Error("setting.SettingPost(UpdateMirror): %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue