Skip to content

Commit

Permalink
Always try to fetch repo for mirrors (#19975)
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
Gusted and wxiaoguang authored Jun 15, 2022
1 parent 1f8f9c3 commit f0ce547
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/mirror/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit f0ce547

Please sign in to comment.