Explorar o código

Retry After Milliseconds, fixes #228

Bruce Marriner %!s(int64=9) %!d(string=hai) anos
pai
achega
5501cac820
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      restapi.go

+ 1 - 1
restapi.go

@@ -149,7 +149,7 @@ func (s *Session) request(method, urlStr, contentType string, b []byte) (respons
 		s.log(LogInformational, "Rate Limiting %s, retry in %d", urlStr, rl.RetryAfter)
 		s.handle(RateLimit{TooManyRequests: &rl, URL: urlStr})
 
-		time.Sleep(rl.RetryAfter)
+		time.Sleep(rl.RetryAfter * time.Millisecond)
 		// we can make the above smarter
 		// this method can cause longer delays then required