fix(rule-engine): console action has no args field

This commit is contained in:
Zaiming (Stone) Shi 2023-09-29 10:30:14 +02:00
parent 1177a32310
commit dc147fd310
1 changed files with 2 additions and 1 deletions

View File

@ -361,8 +361,9 @@ do_handle_action(RuleId, {bridge, BridgeType, BridgeName, ResId}, Selected, _Env
Result ->
Result
end;
do_handle_action(RuleId, #{mod := Mod, func := Func, args := Args}, Selected, Envs) ->
do_handle_action(RuleId, #{mod := Mod, func := Func} = Action, Selected, Envs) ->
%% the function can also throw 'out_of_service'
Args = maps:get(args, Action, []),
Result = Mod:Func(Selected, Envs, Args),
inc_action_metrics(RuleId, Result),
Result.