From 3c0e7d65104805094bed5c94da271cdbf1eafed0 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Wed, 30 Apr 2025 14:09:12 +0800 Subject: [PATCH] fix --- apps/efka/src/efka_micro_service.erl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/efka/src/efka_micro_service.erl b/apps/efka/src/efka_micro_service.erl index 385bdec..934b33b 100644 --- a/apps/efka/src/efka_micro_service.erl +++ b/apps/efka/src/efka_micro_service.erl @@ -166,17 +166,17 @@ handle_info({Port, {exit_status, Code}}, State = #state{port = Port, service = S %% with Reason. The return value is ignored. -spec(terminate(Reason :: (normal | shutdown | {shutdown, term()} | term()), State :: #state{}) -> term()). -terminate(Reason, _State = #state{port = Port}) -> +terminate(Reason, _State = #state{port = Port}) when is_port(Port) -> lager:debug("[efka_micro_service] terminate with reason: ~p", [Reason]), - case is_port(Port) of - true -> - case erlang:port_info(Port, os_pid) of - undefined -> - ok; - {os_pid, OsPid} -> - os:cmd(io_lib:format("kill -9 ~p", [OsPid])) - end + case erlang:port_info(Port, os_pid) of + undefined -> + ok; + {os_pid, OsPid} -> + os:cmd(io_lib:format("kill -9 ~p", [OsPid])) end, + ok; +terminate(Reason, _State = #state{}) -> + lager:debug("[efka_micro_service] terminate with reason: ~p", [Reason]), ok. %% @private