diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index b68e9d26fe16..f56ed34e431e 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -587,8 +587,8 @@ Two special environment variables are passed to the render command: ## Migrations (`migrations`) -- `RETRY_MAX_TIMES`: **3**: Retry times on migrations for every http/https request. -- `RETRY_DELAY`: **3**: Time as seconds to delay before next retry. +- `MAX_ATTEMPTS`: **3**: Max attempts per http/https request on migrations. +- `RETRY_BACKOFF`: **3**: Backoff time per http/https request retry (seconds) ## Other (`other`) diff --git a/docs/content/doc/advanced/config-cheat-sheet.zh-cn.md b/docs/content/doc/advanced/config-cheat-sheet.zh-cn.md index ba4aa3762293..22e47f810f6d 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.zh-cn.md +++ b/docs/content/doc/advanced/config-cheat-sheet.zh-cn.md @@ -274,8 +274,8 @@ IS_INPUT_FILE = false ## Migrations (`migrations`) -- `RETRY_MAX_TIMES`: **3**: 在迁移过程中的 http/https 请求重试次数。 -- `RETRY_DELAY`: **3**: 等待下一次重试的时间,单位秒。 +- `MAX_ATTEMPTS`: **3**: 在迁移过程中的 http/https 请求重试次数。 +- `RETRY_BACKOFF`: **3**: 等待下一次重试的时间,单位秒。 ## Other (`other`) diff --git a/modules/migrations/base/downloader.go b/modules/migrations/base/downloader.go index 020df9af9b9c..b853ec30209a 100644 --- a/modules/migrations/base/downloader.go +++ b/modules/migrations/base/downloader.go @@ -46,6 +46,7 @@ func NewRetryDownloader(downloader Downloader, retryTimes, retryDelay int) *Retr } } +// GetRepoInfo returns a repository information with retry func (d *RetryDownloader) GetRepoInfo() (*Repository, error) { var ( times = d.RetryTimes @@ -61,6 +62,7 @@ func (d *RetryDownloader) GetRepoInfo() (*Repository, error) { return nil, err } +// GetTopics returns a repository's topics with retry func (d *RetryDownloader) GetTopics() ([]string, error) { var ( times = d.RetryTimes @@ -76,6 +78,7 @@ func (d *RetryDownloader) GetTopics() ([]string, error) { return nil, err } +// GetMilestones returns a repository's milestones with retry func (d *RetryDownloader) GetMilestones() ([]*Milestone, error) { var ( times = d.RetryTimes @@ -91,6 +94,7 @@ func (d *RetryDownloader) GetMilestones() ([]*Milestone, error) { return nil, err } +// GetReleases returns a repository's releases with retry func (d *RetryDownloader) GetReleases() ([]*Release, error) { var ( times = d.RetryTimes @@ -106,6 +110,7 @@ func (d *RetryDownloader) GetReleases() ([]*Release, error) { return nil, err } +// GetLabels returns a repository's labels with retry func (d *RetryDownloader) GetLabels() ([]*Label, error) { var ( times = d.RetryTimes @@ -121,6 +126,7 @@ func (d *RetryDownloader) GetLabels() ([]*Label, error) { return nil, err } +// GetIssues returns a repository's issues with retry func (d *RetryDownloader) GetIssues(page, perPage int) ([]*Issue, bool, error) { var ( times = d.RetryTimes @@ -137,6 +143,7 @@ func (d *RetryDownloader) GetIssues(page, perPage int) ([]*Issue, bool, error) { return nil, false, err } +// GetComments returns a repository's comments with retry func (d *RetryDownloader) GetComments(issueNumber int64) ([]*Comment, error) { var ( times = d.RetryTimes @@ -152,6 +159,7 @@ func (d *RetryDownloader) GetComments(issueNumber int64) ([]*Comment, error) { return nil, err } +// GetPullRequests returns a repository's pull requests with retry func (d *RetryDownloader) GetPullRequests(page, perPage int) ([]*PullRequest, error) { var ( times = d.RetryTimes