fix: disable rule if build fail
This commit is contained in:
parent
19a9bab3a4
commit
4178e1a023
|
@ -396,6 +396,7 @@ refresh_rules() ->
|
||||||
lists:foreach(fun(#rule{id = RuleId} = Rule) ->
|
lists:foreach(fun(#rule{id = RuleId} = Rule) ->
|
||||||
try refresh_rule(Rule)
|
try refresh_rule(Rule)
|
||||||
catch Error:Reason:ST ->
|
catch Error:Reason:ST ->
|
||||||
|
emqx_rule_registry:add_rule(Rule#rule{enabled = false}),
|
||||||
logger:critical(
|
logger:critical(
|
||||||
"Can not re-build rule ~p: ~0p. The rule is disabled."
|
"Can not re-build rule ~p: ~0p. The rule is disabled."
|
||||||
"Fix the issue and enable it manually.\n"
|
"Fix the issue and enable it manually.\n"
|
||||||
|
|
Loading…
Reference in New Issue