diff options
Diffstat (limited to 'models/repo_mirror.go')
-rw-r--r-- | models/repo_mirror.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/repo_mirror.go b/models/repo_mirror.go index d8d4bc0bec..67ae449bde 100644 --- a/models/repo_mirror.go +++ b/models/repo_mirror.go @@ -27,8 +27,8 @@ type Mirror struct { ID int64 `xorm:"pk autoincr"` RepoID int64 `xorm:"INDEX"` Repo *Repository `xorm:"-"` - Interval int // Hour. - EnablePrune bool `xorm:"NOT NULL DEFAULT true"` + Interval time.Duration + EnablePrune bool `xorm:"NOT NULL DEFAULT true"` Updated time.Time `xorm:"-"` UpdatedUnix int64 `xorm:"INDEX"` @@ -68,7 +68,7 @@ func (m *Mirror) AfterSet(colName string, _ xorm.Cell) { // ScheduleNextUpdate calculates and sets next update time. func (m *Mirror) ScheduleNextUpdate() { - m.NextUpdate = time.Now().Add(time.Duration(m.Interval) * time.Hour) + m.NextUpdate = time.Now().Add(m.Interval) } func (m *Mirror) readAddress() { |