Fix refillrate setting on Take

This commit is contained in:
ChronosX88 2021-01-25 17:47:18 +03:00
parent 8752f68e29
commit e7a5e86067
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A

View File

@ -96,7 +96,7 @@ func (t *Throttle) Take(rateLimit time.Duration, cost float64) rxgo.Observable {
if rateLimit == 0 {
t.config.RefillRate = 0
} else {
t.config.RefillRate = float64(1 / rateLimit.Nanoseconds())
t.config.RefillRate = 1.0 / float64(rateLimit.Nanoseconds())
}
return rxgo.FromChannel(ch)
}