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