]> source.dussan.org Git - gitea.git/commitdiff
migration: github: if rate limit is not enabled, ignore it (#15490)
author6543 <6543@obermui.de>
Thu, 15 Apr 2021 13:34:22 +0000 (15:34 +0200)
committerGitHub <noreply@github.com>
Thu, 15 Apr 2021 13:34:22 +0000 (15:34 +0200)
modules/migrations/github.go

index cb61086b2ad6b3d4dc689df6b23b994847bd6795..282e3b478615114e1762eaa9860a1cbe28c1a61d 100644 (file)
@@ -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
        }