Correct rate limit test magnitude

This commit is contained in:
Carson Hoffman 2021-01-20 19:42:53 -05:00
parent 9548146f69
commit b7a2a4b7fa
No known key found for this signature in database
GPG key ID: 05B660CB452C657F

View file

@ -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)