Skip to content

Commit

Permalink
migration: github: if rate limit is not enabled, ignore it (go-gitea#…
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Apr 15, 2021
1 parent 85880b2 commit 345a35a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/migrations/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ func (g *GithubDownloaderV3) sleep() {
func (g *GithubDownloaderV3) RefreshRate() error {
rates, _, err := g.client.RateLimits(g.ctx)
if err != nil {
// if rate limit is not enabled, ignore it
if strings.Contains(err.Error(), "404") {
g.rate = nil
return nil
}
return err
}

Expand Down

0 comments on commit 345a35a

Please sign in to comment.