chore(ft): tidy up the code according to the review

This commit is contained in:
Ilya Averyanov 2023-08-29 23:21:36 +03:00
parent 279895b8fd
commit 54ac4a8527
4 changed files with 5 additions and 4 deletions

View File

@ -1049,7 +1049,7 @@ handle_out(disconnect, {ReasonCode, ReasonName}, Channel) ->
handle_out(disconnect, {ReasonCode, ReasonName, #{}}, Channel); handle_out(disconnect, {ReasonCode, ReasonName, #{}}, Channel);
handle_out(disconnect, {ReasonCode, ReasonName, Props}, Channel = ?IS_MQTT_V5) -> handle_out(disconnect, {ReasonCode, ReasonName, Props}, Channel = ?IS_MQTT_V5) ->
Packet = ?DISCONNECT_PACKET(ReasonCode, Props), Packet = ?DISCONNECT_PACKET(ReasonCode, Props),
{ok, [?REPLY_OUTGOING(Packet), {close, ReasonName}], Channel}; {ok, [?REPLY_OUTGOING(Packet), ?REPLY_CLOSE(ReasonName)], Channel};
handle_out(disconnect, {_ReasonCode, ReasonName, _Props}, Channel) -> handle_out(disconnect, {_ReasonCode, ReasonName, _Props}, Channel) ->
{ok, {close, ReasonName}, Channel}; {ok, {close, ReasonName}, Channel};
handle_out(auth, {ReasonCode, Properties}, Channel) -> handle_out(auth, {ReasonCode, Properties}, Channel) ->

View File

@ -22,7 +22,6 @@
start(_StartType, _StartArgs) -> start(_StartType, _StartArgs) ->
{ok, Sup} = emqx_ft_sup:start_link(), {ok, Sup} = emqx_ft_sup:start_link(),
ok = emqx_ft_async_reply:create_tables(),
ok = emqx_ft_conf:load(), ok = emqx_ft_conf:load(),
{ok, Sup}. {ok, Sup}.

View File

@ -62,8 +62,8 @@ create_tables() ->
{read_concurrency, true}, {read_concurrency, true},
{write_concurrency, true} {write_concurrency, true}
], ],
_ = ets:new(?MON_TAB, EtsOptions), ok = emqx_utils_ets:new(?MON_TAB, EtsOptions),
_ = ets:new(?PACKET_TAB, EtsOptions), ok = emqx_utils_ets:new(?PACKET_TAB, EtsOptions),
ok. ok.
-spec register(packet_id(), mon_ref(), timer_ref()) -> ok. -spec register(packet_id(), mon_ref(), timer_ref()) -> ok.

View File

@ -28,6 +28,8 @@ start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []). supervisor:start_link({local, ?SERVER}, ?MODULE, []).
init([]) -> init([]) ->
ok = emqx_ft_async_reply:create_tables(),
SupFlags = #{ SupFlags = #{
strategy => one_for_one, strategy => one_for_one,
intensity => 100, intensity => 100,