fix(limiter): fix initial value error for `obtained`
This commit is contained in:
parent
7b559193d1
commit
d863a60cff
|
@ -507,6 +507,7 @@ make_bucket([{Name, Conf} | T], Type, GlobalCfg, Factor, CounterNum, DelayBucket
|
||||||
infinity ->
|
infinity ->
|
||||||
Rate = infinity,
|
Rate = infinity,
|
||||||
Capacity = infinity,
|
Capacity = infinity,
|
||||||
|
Initial = 0,
|
||||||
Ref = emqx_limiter_bucket_ref:new(undefined, undefined, Rate),
|
Ref = emqx_limiter_bucket_ref:new(undefined, undefined, Rate),
|
||||||
emqx_limiter_manager:insert_bucket(Path, Ref),
|
emqx_limiter_manager:insert_bucket(Path, Ref),
|
||||||
CounterNum2 = CounterNum,
|
CounterNum2 = CounterNum,
|
||||||
|
@ -528,7 +529,7 @@ make_bucket([{Name, Conf} | T], Type, GlobalCfg, Factor, CounterNum, DelayBucket
|
||||||
Bucket = #{
|
Bucket = #{
|
||||||
name => Name,
|
name => Name,
|
||||||
rate => Rate,
|
rate => Rate,
|
||||||
obtained => 0,
|
obtained => Initial,
|
||||||
correction => 0,
|
correction => 0,
|
||||||
capacity => Capacity,
|
capacity => Capacity,
|
||||||
counter => undefined,
|
counter => undefined,
|
||||||
|
|
Loading…
Reference in New Issue