1
0
Fork 0
forked from forgejo/forgejo

Sleep longer if request speed is over github limitation (#9335)

* Sleep longer if request speed is over github limitation

* improve code

* remove unused code

* fix lint

* Use github's rate limit remain value to determine how long to sleep

* Save reset time when finished github api request

* fix bug

* fix lint

* Add context.Context for sleep

* fix test

* improve code

* fix bug and lint

* fix import order
This commit is contained in:
Lunny Xiao 2019-12-17 12:16:54 +08:00 committed by techknowlogick
parent d1a49977b0
commit ffc904b1e0
8 changed files with 86 additions and 16 deletions

View file

@ -5,6 +5,8 @@
package migrations
import (
"context"
"code.gitea.io/gitea/modules/migrations/base"
)
@ -28,6 +30,10 @@ func NewPlainGitDownloader(ownerName, repoName, remoteURL string) *PlainGitDownl
}
}
// SetContext set context
func (g *PlainGitDownloader) SetContext(ctx context.Context) {
}
// GetRepoInfo returns a repository information
func (g *PlainGitDownloader) GetRepoInfo() (*base.Repository, error) {
// convert github repo to stand Repo