summaryrefslogtreecommitdiffstats
path: root/modules/migrations/base
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-04-20 04:23:28 +0200
committerGitHub <noreply@github.com>2020-04-20 03:23:28 +0100
commite37e217602989afd9f5700827a0b10377f793397 (patch)
treec97b46153efa932c4a2e13a95cb14f539c376d8f /modules/migrations/base
parent842bba94ac9649352bbb23f997b49738e38057de (diff)
downloadgitea-e37e217602989afd9f5700827a0b10377f793397.tar.gz
gitea-e37e217602989afd9f5700827a0b10377f793397.zip
[Fix] RetryDownloader (add GetReviews()) (#11093)
* add GetReviews() to RetryDownloader
Diffstat (limited to 'modules/migrations/base')
-rw-r--r--modules/migrations/base/downloader.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/migrations/base/downloader.go b/modules/migrations/base/downloader.go
index 5de8c9513b..c31f3df1d1 100644
--- a/modules/migrations/base/downloader.go
+++ b/modules/migrations/base/downloader.go
@@ -186,3 +186,19 @@ func (d *RetryDownloader) GetPullRequests(page, perPage int) ([]*PullRequest, er
}
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
+}