diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-06-15 17:58:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-15 23:58:44 +0800 |
commit | f0ce5470e5d58a118daf8dde4b35dce904892a35 (patch) | |
tree | 6a2248883a4f0c7bb978cdd80ac230c91f8cc451 /services/mirror | |
parent | 1f8f9c3826643b8c3a0c3da1dc15090af736f5a6 (diff) | |
download | gitea-f0ce5470e5d58a118daf8dde4b35dce904892a35.tar.gz gitea-f0ce5470e5d58a118daf8dde4b35dce904892a35.zip |
Always try to fetch repo for mirrors (#19975)
- Always give a best-effort to fetching the repositories, if even that
fails indeed give a disconnected mirror found error.
- *Partially* resolves #19928
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/mirror')
-rw-r--r-- | services/mirror/mirror.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/mirror/mirror.go b/services/mirror/mirror.go index edc5a84d22..013adac0f4 100644 --- a/services/mirror/mirror.go +++ b/services/mirror/mirror.go @@ -63,7 +63,7 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error { var item SyncRequest var repo *repo_model.Repository if m, ok := bean.(*repo_model.Mirror); ok { - if m.Repo == nil { + if m.GetRepository() == nil { log.Error("Disconnected mirror found: %d", m.ID) return nil } @@ -73,7 +73,7 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error { ReferenceID: m.RepoID, } } else if m, ok := bean.(*repo_model.PushMirror); ok { - if m.Repo == nil { + if m.GetRepository() == nil { log.Error("Disconnected push-mirror found: %d", m.ID) return nil } |