fix(rule): fix edit rule fail in the cluster
This commit is contained in:
parent
4664b85968
commit
3ad0678892
|
@ -1,6 +1,6 @@
|
|||
{application, emqx_rule_engine,
|
||||
[{description, "EMQ X Rule Engine"},
|
||||
{vsn, "4.3.4"}, % strict semver, bump manually!
|
||||
{vsn, "4.3.5"}, % strict semver, bump manually!
|
||||
{modules, []},
|
||||
{registered, [emqx_rule_engine_sup, emqx_rule_registry]},
|
||||
{applications, [kernel,stdlib,rulesql,getopt]},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%% -*-: erlang -*-
|
||||
{"4.3.4",
|
||||
{"4.3.5",
|
||||
[ {"4.3.0",
|
||||
[ {load_module, emqx_rule_funcs, brutal_purge, soft_purge, []}
|
||||
, {load_module, emqx_rule_engine, brutal_purge, soft_purge, []}
|
||||
|
@ -23,6 +23,9 @@
|
|||
[ {load_module, emqx_rule_engine, brutal_purge, soft_purge, []}
|
||||
, {load_module, emqx_rule_actions, brutal_purge, soft_purge, []}
|
||||
]},
|
||||
{"4.3.4",
|
||||
[ {load_module, emqx_rule_engine, brutal_purge, soft_purge, []}
|
||||
]},
|
||||
{<<".*">>, []}
|
||||
],
|
||||
[
|
||||
|
@ -49,6 +52,9 @@
|
|||
[ {load_module, emqx_rule_engine, brutal_purge, soft_purge, []}
|
||||
, {load_module, emqx_rule_actions, brutal_purge, soft_purge, []}
|
||||
]},
|
||||
{"4.3.4",
|
||||
[ {load_module, emqx_rule_engine, brutal_purge, soft_purge, []}
|
||||
]},
|
||||
{<<".*">>, []}
|
||||
]
|
||||
}.
|
||||
|
|
|
@ -475,10 +475,10 @@ may_update_rule_params(Rule = #rule{enabled = OldEnb, actions = Actions, state =
|
|||
Params = #{enabled := NewEnb}) ->
|
||||
State = case {OldEnb, NewEnb} of
|
||||
{false, true} ->
|
||||
refresh_rule(Rule),
|
||||
_ = ?CLUSTER_CALL(refresh_rule, [Rule]),
|
||||
force_changed;
|
||||
{true, false} ->
|
||||
clear_actions(Actions),
|
||||
_ = ?CLUSTER_CALL(clear_actions, [Actions]),
|
||||
force_changed;
|
||||
_NoChange -> OldState
|
||||
end,
|
||||
|
@ -637,7 +637,7 @@ refresh_actions(Actions, Pred) ->
|
|||
true ->
|
||||
{ok, #action{module = Mod, on_create = Create}}
|
||||
= emqx_rule_registry:find_action(ActName),
|
||||
_ = ?CLUSTER_CALL(init_action, [Mod, Create, Id, with_resource_params(Args)]),
|
||||
_ = init_action(Mod, Create, Id, with_resource_params(Args)),
|
||||
refresh_actions(Fallbacks, Pred);
|
||||
false -> ok
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue