Skip to content

Commit 94f5dd3

Browse files
Gustedwxiaoguang
authored andcommitted
Always try to fetch repo for mirrors (go-gitea#19975)
- Always give a best-effort to fetching the repositories, if even that fails indeed give a disconnected mirror found error. - *Partially* resolves go-gitea#19928 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 parent 81c9812 commit 94f5dd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/mirror/mirror.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error {
6363
var item SyncRequest
6464
var repo *repo_model.Repository
6565
if m, ok := bean.(*repo_model.Mirror); ok {
66-
if m.Repo == nil {
66+
if m.GetRepository() == nil {
6767
log.Error("Disconnected mirror found: %d", m.ID)
6868
return nil
6969
}
@@ -73,7 +73,7 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error {
7373
ReferenceID: m.RepoID,
7474
}
7575
} else if m, ok := bean.(*repo_model.PushMirror); ok {
76-
if m.Repo == nil {
76+
if m.GetRepository() == nil {
7777
log.Error("Disconnected push-mirror found: %d", m.ID)
7878
return nil
7979
}

0 commit comments

Comments
 (0)