boo
parent
f71295b40f
commit
d810796e32
|
|
@ -3,7 +3,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"time"
|
|
||||||
|
|
||||||
"golang.org/x/time/rate"
|
"golang.org/x/time/rate"
|
||||||
)
|
)
|
||||||
|
|
@ -16,7 +15,6 @@ type throttledWriter struct {
|
||||||
|
|
||||||
func (tw throttledWriter) Write(b []byte) (int, error) {
|
func (tw throttledWriter) Write(b []byte) (int, error) {
|
||||||
if tw.limiter != nil {
|
if tw.limiter != nil {
|
||||||
start := time.Now()
|
|
||||||
if block := tw.limiter.Burst(); len(b) > block {
|
if block := tw.limiter.Burst(); len(b) > block {
|
||||||
b = b[:block]
|
b = b[:block]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue