chore(ft): fix typing issues

This commit is contained in:
Ilya Averyanov 2023-02-16 20:32:12 +02:00
parent 2c9cd1397d
commit 228bf1a0ce
3 changed files with 10 additions and 11 deletions

View File

@ -184,9 +184,9 @@ on_init(PacketId, Msg, Transfer) ->
ok ->
emqx_ft_responder:ack(PacketKey, ok);
% Storage operation started, packet will be acked by the responder
{async, Pid} ->
ok = emqx_ft_responder:kickoff(PacketKey, Pid),
ok;
% {async, Pid} ->
% ok = emqx_ft_responder:kickoff(PacketKey, Pid),
% ok;
%% Storage operation failed, ack through the responder
{error, _} = Error ->
emqx_ft_responder:ack(PacketKey, Error)
@ -227,9 +227,9 @@ on_segment(PacketId, Msg, Transfer, Offset, Checksum) ->
case store_segment(Transfer, Segment) of
ok ->
emqx_ft_responder:ack(PacketKey, ok);
{async, Pid} ->
ok = emqx_ft_responder:kickoff(PacketKey, Pid),
ok;
% {async, Pid} ->
% ok = emqx_ft_responder:kickoff(PacketKey, Pid),
% ok;
{error, _} = Error ->
emqx_ft_responder:ack(PacketKey, Error)
end
@ -251,8 +251,8 @@ on_fin(PacketId, Msg, Transfer, Checksum) ->
with_responder(FinPacketKey, Callback, ?ASSEMBLE_TIMEOUT, fun() ->
case assemble(Transfer) of
%% Assembling completed, ack through the responder right away
ok ->
emqx_ft_responder:ack(FinPacketKey, ok);
% ok ->
% emqx_ft_responder:ack(FinPacketKey, ok);
%% Assembling started, packet will be acked by the responder
{async, Pid} ->
ok = emqx_ft_responder:kickoff(FinPacketKey, Pid),

View File

@ -42,7 +42,7 @@
%% API
%% -------------------------------------------------------------------
-spec start(key(), timeout(), respfun()) -> startlink_ret().
-spec start(key(), respfun(), timeout()) -> startlink_ret().
start(Key, RespFun, Timeout) ->
emqx_ft_responder_sup:start_child(Key, RespFun, Timeout).

View File

@ -78,8 +78,7 @@
-define(MANIFEST, "MANIFEST.json").
-define(SEGMENT, "SEG").
%% TODO
-type storage() :: emqx_config:config().
-type storage() :: emqx_ft_storage:storage().
%% Store manifest in the backing filesystem.
%% Atomic operation.