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]) -> code_change({down, _Vsn}, State = #state{metric_ids = MIDs}, [Vsn]) ->
case string:tokens(Vsn, ".") of case string:tokens(Vsn, ".") of
["4", "3", Val] -> ["4", "3", SVal] ->
case string:to_integer(Val) =< 7 of {Val, []} = string:to_integer(SVal),
case Val =< 7 of
true -> true ->
[begin [begin
Passed = get_rules_passed(Id), 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]) -> code_change(_Vsn, State = #state{metric_ids = MIDs}, [Vsn]) ->
case string:tokens(Vsn, ".") of case string:tokens(Vsn, ".") of
["4", "3", Val] -> ["4", "3", SVal] ->
case string:to_integer(Val) =< 7 of {Val, []} = string:to_integer(SVal),
case Val =< 7 of
true -> true ->
[begin [begin
Matched = get_rules_matched(Id), Matched = get_rules_matched(Id),