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:
parent
d1a49977b0
commit
ffc904b1e0
8 changed files with 86 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue