Browse Source

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

Zaiming (Stone) Shi 2 năm trước cách đây
mục cha
commit
dc147fd310

+ 2 - 1
apps/emqx_rule_engine/src/emqx_rule_runtime.erl

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