From: Jonas Bröms Date: Wed, 18 Oct 2017 18:50:41 +0000 (+0200) Subject: Only update mirror last update after successful sync (#2730) X-Git-Tag: v1.3.0-rc1~109 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=847272a70d403178db6e3595aa162a3710be5bc8;p=gitea.git Only update mirror last update after successful sync (#2730) --- diff --git a/models/repo_mirror.go b/models/repo_mirror.go index 6419c0ba17..77cd98faa8 100644 --- a/models/repo_mirror.go +++ b/models/repo_mirror.go @@ -50,7 +50,7 @@ func (m *Mirror) BeforeInsert() { // BeforeUpdate is invoked from XORM before updating this object. func (m *Mirror) BeforeUpdate() { if m != nil { - m.UpdatedUnix = time.Now().Unix() + m.UpdatedUnix = m.Updated.Unix() m.NextUpdateUnix = m.NextUpdate.Unix() } } @@ -179,6 +179,7 @@ func (m *Mirror) runSync() bool { } } + m.Updated = time.Now() return true }