Skip to content

Commit

Permalink
migration: github: if rate limit is not enabled, ignore it (#15490) (#…
Browse files Browse the repository at this point in the history
…15495)

Co-authored-by: Lauris BH <[email protected]>
  • Loading branch information
6543 and lafriks authored Apr 15, 2021
1 parent b228a0a commit 729fa06
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 729fa06

Please sign in to comment.