style: please elvis checks
This commit is contained in:
parent
0c76b6cf4d
commit
e76f67e985
|
@ -20,6 +20,8 @@
|
||||||
, cancel_alarms/3
|
, cancel_alarms/3
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
-elvis([{elvis_style, invalid_dynamic_call, #{ignore => [emqx_congestion]}}]).
|
||||||
|
|
||||||
-define(ALARM_CONN_CONGEST(Channel, Reason),
|
-define(ALARM_CONN_CONGEST(Channel, Reason),
|
||||||
list_to_binary(
|
list_to_binary(
|
||||||
io_lib:format("~ts/~ts/~ts",
|
io_lib:format("~ts/~ts/~ts",
|
||||||
|
|
|
@ -335,7 +335,8 @@ t_handle_info(_) ->
|
||||||
|
|
||||||
t_ensure_rate_limit(_) ->
|
t_ensure_rate_limit(_) ->
|
||||||
WhenOk = fun emqx_connection:next_incoming_msgs/3,
|
WhenOk = fun emqx_connection:next_incoming_msgs/3,
|
||||||
{ok, [], State} = emqx_connection:check_limiter([], [], WhenOk, [], st(#{limiter => undefined})),
|
{ok, [], State} = emqx_connection:check_limiter([], [], WhenOk, [],
|
||||||
|
st(#{limiter => undefined})),
|
||||||
?assertEqual(undefined, emqx_connection:info(limiter, State)),
|
?assertEqual(undefined, emqx_connection:info(limiter, State)),
|
||||||
|
|
||||||
Limiter = init_limiter(),
|
Limiter = init_limiter(),
|
||||||
|
@ -344,7 +345,8 @@ t_ensure_rate_limit(_) ->
|
||||||
|
|
||||||
ok = meck:expect(emqx_htb_limiter, check,
|
ok = meck:expect(emqx_htb_limiter, check,
|
||||||
fun(_, Client) -> {pause, 3000, undefined, Client} end),
|
fun(_, Client) -> {pause, 3000, undefined, Client} end),
|
||||||
{ok, State2} = emqx_connection:check_limiter([{1000, bytes_in}], [], WhenOk, [], st(#{limiter => Limiter})),
|
{ok, State2} = emqx_connection:check_limiter([{1000, bytes_in}], [],
|
||||||
|
WhenOk, [], st(#{limiter => Limiter})),
|
||||||
meck:unload(emqx_htb_limiter),
|
meck:unload(emqx_htb_limiter),
|
||||||
ok = meck:new(emqx_htb_limiter, [passthrough, no_history, no_link]),
|
ok = meck:new(emqx_htb_limiter, [passthrough, no_history, no_link]),
|
||||||
?assertNotEqual(undefined, emqx_connection:info(limiter_timer, State2)).
|
?assertNotEqual(undefined, emqx_connection:info(limiter_timer, State2)).
|
||||||
|
@ -550,7 +552,10 @@ channel(InitFields) ->
|
||||||
maps:fold(fun(Field, Value, Channel) ->
|
maps:fold(fun(Field, Value, Channel) ->
|
||||||
emqx_channel:set_field(Field, Value, Channel)
|
emqx_channel:set_field(Field, Value, Channel)
|
||||||
end,
|
end,
|
||||||
emqx_channel:init(ConnInfo, #{zone => default, limiter => limiter_cfg(), listener => {tcp, default}}),
|
emqx_channel:init(ConnInfo, #{ zone => default
|
||||||
|
, limiter => limiter_cfg()
|
||||||
|
, listener => {tcp, default}
|
||||||
|
}),
|
||||||
maps:merge(#{clientinfo => ClientInfo,
|
maps:merge(#{clientinfo => ClientInfo,
|
||||||
session => Session,
|
session => Session,
|
||||||
conn_state => connected
|
conn_state => connected
|
||||||
|
|
Loading…
Reference in New Issue