[Fix] RetryDownloader (add GetReviews()) (#11093)

* add GetReviews() to RetryDownloader
tokarchuk/v1.17
6543 5 years ago committed by GitHub
parent 842bba94ac
commit e37e217602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      modules/migrations/base/downloader.go

@ -186,3 +186,19 @@ func (d *RetryDownloader) GetPullRequests(page, perPage int) ([]*PullRequest, er
} }
return nil, err return nil, err
} }
// GetReviews returns pull requests reviews
func (d *RetryDownloader) GetReviews(pullRequestNumber int64) ([]*Review, error) {
var (
times = d.RetryTimes
reviews []*Review
err error
)
for ; times > 0; times-- {
if reviews, err = d.Downloader.GetReviews(pullRequestNumber); err == nil {
return reviews, nil
}
time.Sleep(time.Second * time.Duration(d.RetryDelay))
}
return nil, err
}

Loading…
Cancel
Save