Parcourir la source

Correct rate limit test magnitude

Carson Hoffman il y a 3 ans
Parent
commit
b7a2a4b7fa
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      ratelimit_test.go

+ 2 - 2
ratelimit_test.go

@@ -19,7 +19,7 @@ func TestRatelimitReset(t *testing.T) {
 
 		headers.Set("X-RateLimit-Remaining", "0")
 		// Reset for approx 2 seconds from now
-		headers.Set("X-RateLimit-Reset", fmt.Sprint(float64(time.Now().Add(time.Second*2).UnixNano())/1e6))
+		headers.Set("X-RateLimit-Reset", fmt.Sprint(float64(time.Now().Add(time.Second*2).UnixNano())/1e9))
 		headers.Set("Date", time.Now().Format(time.RFC850))
 
 		err := bucket.Release(headers)
@@ -106,7 +106,7 @@ func sendBenchReq(endpoint string, rl *RateLimiter) {
 	headers := http.Header(make(map[string][]string))
 
 	headers.Set("X-RateLimit-Remaining", "10")
-	headers.Set("X-RateLimit-Reset", fmt.Sprint(float64(time.Now().UnixNano())/1e6))
+	headers.Set("X-RateLimit-Reset", fmt.Sprint(float64(time.Now().UnixNano())/1e9))
 	headers.Set("Date", time.Now().Format(time.RFC850))
 
 	bucket.Release(headers)