style: fix problems reported by elvis
This commit is contained in:
parent
5479932190
commit
79440064fe
|
@ -102,52 +102,12 @@ fields("rule_events") ->
|
||||||
];
|
];
|
||||||
fields("rule_test") ->
|
fields("rule_test") ->
|
||||||
[
|
[
|
||||||
{"context",
|
rule_input_message_context(),
|
||||||
sc(
|
|
||||||
hoconsc:union([
|
|
||||||
ref("ctx_pub"),
|
|
||||||
ref("ctx_sub"),
|
|
||||||
ref("ctx_unsub"),
|
|
||||||
ref("ctx_delivered"),
|
|
||||||
ref("ctx_acked"),
|
|
||||||
ref("ctx_dropped"),
|
|
||||||
ref("ctx_connected"),
|
|
||||||
ref("ctx_disconnected"),
|
|
||||||
ref("ctx_connack"),
|
|
||||||
ref("ctx_check_authz_complete"),
|
|
||||||
ref("ctx_bridge_mqtt"),
|
|
||||||
ref("ctx_delivery_dropped")
|
|
||||||
]),
|
|
||||||
#{
|
|
||||||
desc => ?DESC("test_context"),
|
|
||||||
default => #{}
|
|
||||||
}
|
|
||||||
)},
|
|
||||||
{"sql", sc(binary(), #{desc => ?DESC("test_sql"), required => true})}
|
{"sql", sc(binary(), #{desc => ?DESC("test_sql"), required => true})}
|
||||||
];
|
];
|
||||||
fields("rule_apply_test") ->
|
fields("rule_apply_test") ->
|
||||||
[
|
[
|
||||||
{"context",
|
rule_input_message_context(),
|
||||||
sc(
|
|
||||||
hoconsc:union([
|
|
||||||
ref("ctx_pub"),
|
|
||||||
ref("ctx_sub"),
|
|
||||||
ref("ctx_unsub"),
|
|
||||||
ref("ctx_delivered"),
|
|
||||||
ref("ctx_acked"),
|
|
||||||
ref("ctx_dropped"),
|
|
||||||
ref("ctx_connected"),
|
|
||||||
ref("ctx_disconnected"),
|
|
||||||
ref("ctx_connack"),
|
|
||||||
ref("ctx_check_authz_complete"),
|
|
||||||
ref("ctx_bridge_mqtt"),
|
|
||||||
ref("ctx_delivery_dropped")
|
|
||||||
]),
|
|
||||||
#{
|
|
||||||
desc => ?DESC("test_context"),
|
|
||||||
default => #{}
|
|
||||||
}
|
|
||||||
)},
|
|
||||||
{"environment",
|
{"environment",
|
||||||
sc(
|
sc(
|
||||||
typerefl:map(),
|
typerefl:map(),
|
||||||
|
@ -358,6 +318,29 @@ fields("ctx_delivery_dropped") ->
|
||||||
| msg_event_common_fields()
|
| msg_event_common_fields()
|
||||||
].
|
].
|
||||||
|
|
||||||
|
rule_input_message_context() ->
|
||||||
|
{"context",
|
||||||
|
sc(
|
||||||
|
hoconsc:union([
|
||||||
|
ref("ctx_pub"),
|
||||||
|
ref("ctx_sub"),
|
||||||
|
ref("ctx_unsub"),
|
||||||
|
ref("ctx_delivered"),
|
||||||
|
ref("ctx_acked"),
|
||||||
|
ref("ctx_dropped"),
|
||||||
|
ref("ctx_connected"),
|
||||||
|
ref("ctx_disconnected"),
|
||||||
|
ref("ctx_connack"),
|
||||||
|
ref("ctx_check_authz_complete"),
|
||||||
|
ref("ctx_bridge_mqtt"),
|
||||||
|
ref("ctx_delivery_dropped")
|
||||||
|
]),
|
||||||
|
#{
|
||||||
|
desc => ?DESC("test_context"),
|
||||||
|
default => #{}
|
||||||
|
}
|
||||||
|
)}.
|
||||||
|
|
||||||
qos() ->
|
qos() ->
|
||||||
{"qos", sc(emqx_schema:qos(), #{desc => ?DESC("event_qos")})}.
|
{"qos", sc(emqx_schema:qos(), #{desc => ?DESC("event_qos")})}.
|
||||||
|
|
||||||
|
|
|
@ -420,7 +420,7 @@ handle_action(RuleId, ActId, Selected, Envs) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-define(IS_RES_DOWN(R), R == stopped; R == not_connected; R == not_found; R == unhealthy_target).
|
-define(IS_RES_DOWN(R), R == stopped; R == not_connected; R == not_found; R == unhealthy_target).
|
||||||
do_handle_action(RuleId, {bridge, BridgeType, BridgeName, ResId} = Action, Selected, _Envs) ->
|
do_handle_action(_RuleId, {bridge, BridgeType, BridgeName, ResId} = Action, Selected, _Envs) ->
|
||||||
trace_action_bridge("BRIDGE", Action, "bridge_action", #{}, debug),
|
trace_action_bridge("BRIDGE", Action, "bridge_action", #{}, debug),
|
||||||
TraceCtx = do_handle_action_get_trace_context(Action),
|
TraceCtx = do_handle_action_get_trace_context(Action),
|
||||||
ReplyTo = {fun ?MODULE:inc_action_metrics/2, [TraceCtx], #{reply_dropped => true}},
|
ReplyTo = {fun ?MODULE:inc_action_metrics/2, [TraceCtx], #{reply_dropped => true}},
|
||||||
|
|
Loading…
Reference in New Issue