Skip to content

Commit

Permalink
fix docs and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Nov 16, 2019
1 parent f52bf7d commit 8c76204
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Expand Down
4 changes: 2 additions & 2 deletions docs/content/doc/advanced/config-cheat-sheet.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Expand Down
8 changes: 8 additions & 0 deletions modules/migrations/base/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8c76204

Please sign in to comment.