Merge pull request #8193 from lafirest/fix/limiter_infinity_rate

fix(limiter): fix counter rate calc error
This commit is contained in:
JianBo He 2022-06-13 17:31:54 +08:00 committed by GitHub
commit 4ac151c9d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -570,10 +570,7 @@ init_counter(Path, Counter, Index, Rate, Initial, State) ->
{Counter, Index, State}. {Counter, Index, State}.
%% @doc find first limited node %% @doc find first limited node
get_counter_rate(#{rate := Rate, capacity := Capacity}, _GlobalCfg) when get_counter_rate(#{rate := Rate}, _GlobalCfg) when Rate =/= infinity ->
%% TODO maybe no need to check capacity
Rate =/= infinity orelse Capacity =/= infinity
->
Rate; Rate;
get_counter_rate(_Cfg, #{rate := Rate}) -> get_counter_rate(_Cfg, #{rate := Rate}) ->
Rate. Rate.