chore: fix elvis warnings

This commit is contained in:
JianBo He 2022-03-09 13:44:53 +08:00
parent 5436a3c496
commit e72e49b291
2 changed files with 8 additions and 4 deletions

View File

@ -103,6 +103,8 @@
-define(T_TAKEOVER, 15000). -define(T_TAKEOVER, 15000).
-define(DEFAULT_BATCH_SIZE, 10000). -define(DEFAULT_BATCH_SIZE, 10000).
-elvis([{elvis_style, invalid_dynamic_call, disable}]).
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% APIs %% APIs
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
@ -391,7 +393,7 @@ takeover_session(GwName, ClientId) ->
[ChanPid] -> [ChanPid] ->
do_takeover_session(GwName, ClientId, ChanPid); do_takeover_session(GwName, ClientId, ChanPid);
ChanPids -> ChanPids ->
[ChanPid|StalePids] = lists:reverse(ChanPids), [ChanPid | StalePids] = lists:reverse(ChanPids),
?SLOG(warning, #{ msg => "more_than_one_channel_found" ?SLOG(warning, #{ msg => "more_than_one_channel_found"
, chan_pids => ChanPids , chan_pids => ChanPids
}), }),
@ -656,7 +658,7 @@ init(Options) ->
TabOpts = [public, {write_concurrency, true}], TabOpts = [public, {write_concurrency, true}],
{ChanTab, ConnTab, InfoTab} = cmtabs(GwName), {ChanTab, ConnTab, InfoTab} = cmtabs(GwName),
ok = emqx_tables:new(ChanTab, [bag, {read_concurrency, true}|TabOpts]), ok = emqx_tables:new(ChanTab, [bag, {read_concurrency, true} | TabOpts]),
ok = emqx_tables:new(ConnTab, [bag | TabOpts]), ok = emqx_tables:new(ConnTab, [bag | TabOpts]),
ok = emqx_tables:new(InfoTab, [set, compressed | TabOpts]), ok = emqx_tables:new(InfoTab, [set, compressed | TabOpts]),

View File

@ -74,8 +74,10 @@
, listeners => [] , listeners => []
}. }.
-elvis([{elvis_style, god_modules, disable}]). -elvis([ {elvis_style, god_modules, disable}
-elvis([{elvis_style, no_nested_try_catch, disable}]). , {elvis_style, no_nested_try_catch, disable}
, {elvis_style, invalid_dynamic_call, disable}
]).
-define(DEFAULT_CALL_TIMEOUT, 15000). -define(DEFAULT_CALL_TIMEOUT, 15000).