chore(ft): fix `?tp` calls

This commit is contained in:
Ilya Averyanov 2023-02-16 18:13:14 +02:00
parent 1c61165a91
commit 2c9cd1397d
1 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ handle_call({kickoff, Pid}, _From, St) ->
{reply, ok, St};
handle_call({ack, Result}, _From, {Key, RespFun}) ->
Ret = apply(RespFun, [{ack, Result}]),
?tp(ft_responder_ack, #{key => Key, result => Result, return => Ret}),
?tp(debug, ft_responder_ack, #{key => Key, result => Result, return => Ret}),
{stop, {shutdown, Ret}, Ret, undefined};
handle_call(Msg, _From, State) ->
?SLOG(warning, #{msg => "unknown_call", call_msg => Msg}),
@ -87,11 +87,11 @@ handle_cast(Msg, State) ->
handle_info(timeout, {Key, RespFun}) ->
Ret = apply(RespFun, [timeout]),
?tp(ft_responder_timeout, #{key => Key, return => Ret}),
?tp(debug, ft_responder_timeout, #{key => Key, return => Ret}),
{stop, {shutdown, Ret}, undefined};
handle_info({'DOWN', _MRef, process, _Pid, Reason}, {Key, RespFun}) ->
Ret = apply(RespFun, [{down, map_down_reason(Reason)}]),
?tp(ft_responder_procdown, #{key => Key, reason => Reason, return => Ret}),
?tp(debug, ft_responder_procdown, #{key => Key, reason => Reason, return => Ret}),
{stop, {shutdown, Ret}, undefined};
handle_info(Msg, State) ->
?SLOG(warning, #{msg => "unknown_message", info_msg => Msg}),
@ -101,7 +101,7 @@ terminate(_Reason, undefined) ->
ok;
terminate(Reason, {Key, RespFun}) ->
Ret = apply(RespFun, [timeout]),
?tp(ft_responder_shutdown, #{key => Key, reason => Reason, return => Ret}),
?tp(debug, ft_responder_shutdown, #{key => Key, reason => Reason, return => Ret}),
ok.
map_down_reason(normal) ->