fix
This commit is contained in:
parent
86b44a84eb
commit
3c0e7d6510
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user