summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-04-15 17:24:01 +0200
committerGitHub <noreply@github.com>2021-04-15 18:24:01 +0300
commit729fa064681bf3f2c98435e3da760e20aa10bf30 (patch)
tree05a5dc4a5e61d541c0ace05cbaac9112555d5228
parentb228a0aa4461aabac2656d532b7caee75463ade9 (diff)
downloadgitea-729fa064681bf3f2c98435e3da760e20aa10bf30.tar.gz
gitea-729fa064681bf3f2c98435e3da760e20aa10bf30.zip
migration: github: if rate limit is not enabled, ignore it (#15490) (#15495)
Co-authored-by: Lauris BH <lauris@nix.lv>
-rw-r--r--modules/migrations/github.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/migrations/github.go b/modules/migrations/github.go
index cb61086b2a..282e3b4786 100644
--- a/modules/migrations/github.go
+++ b/modules/migrations/github.go
@@ -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
}