fix(rule_engine_metrics): fxi string:to_integer pattern match error

This commit is contained in:
EMQ-YangM 2022-01-11 19:22:38 -08:00
parent de58c8e7bc
commit da8cd5d103
1 changed files with 6 additions and 4 deletions

View File

@ -326,8 +326,9 @@ handle_info(_Info, State) ->
code_change({down, _Vsn}, State = #state{metric_ids = MIDs}, [Vsn]) ->
case string:tokens(Vsn, ".") of
["4", "3", Val] ->
case string:to_integer(Val) =< 7 of
["4", "3", SVal] ->
{Val, []} = string:to_integer(SVal),
case Val =< 7 of
true ->
[begin
Passed = get_rules_passed(Id),
@ -353,8 +354,9 @@ code_change({down, _Vsn}, State = #state{metric_ids = MIDs}, [Vsn]) ->
code_change(_Vsn, State = #state{metric_ids = MIDs}, [Vsn]) ->
case string:tokens(Vsn, ".") of
["4", "3", Val] ->
case string:to_integer(Val) =< 7 of
["4", "3", SVal] ->
{Val, []} = string:to_integer(SVal),
case Val =< 7 of
true ->
[begin
Matched = get_rules_matched(Id),