fix: problem in burst limit
This commit is contained in:
parent
461f6955d6
commit
251fe6a6c5
@ -50,9 +50,14 @@ func main() {
|
|||||||
|
|
||||||
// Every 200 milliseconds we'll try to add a new
|
// Every 200 milliseconds we'll try to add a new
|
||||||
// value to `burstyLimiter`, up to its limit of 3.
|
// value to `burstyLimiter`, up to its limit of 3.
|
||||||
|
// If there is no space left then we continue.
|
||||||
go func() {
|
go func() {
|
||||||
for t := range time.Tick(200 * time.Millisecond) {
|
for t := range time.Tick(200 * time.Millisecond) {
|
||||||
burstyLimiter <- t
|
select {
|
||||||
|
case burstyLimiter <- t:
|
||||||
|
default:
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user