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.
|
%% with Reason. The return value is ignored.
|
||||||
-spec(terminate(Reason :: (normal | shutdown | {shutdown, term()} | term()),
|
-spec(terminate(Reason :: (normal | shutdown | {shutdown, term()} | term()),
|
||||||
State :: #state{}) -> 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]),
|
lager:debug("[efka_micro_service] terminate with reason: ~p", [Reason]),
|
||||||
case is_port(Port) of
|
case erlang:port_info(Port, os_pid) of
|
||||||
true ->
|
undefined ->
|
||||||
case erlang:port_info(Port, os_pid) of
|
ok;
|
||||||
undefined ->
|
{os_pid, OsPid} ->
|
||||||
ok;
|
os:cmd(io_lib:format("kill -9 ~p", [OsPid]))
|
||||||
{os_pid, OsPid} ->
|
|
||||||
os:cmd(io_lib:format("kill -9 ~p", [OsPid]))
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
|
ok;
|
||||||
|
terminate(Reason, _State = #state{}) ->
|
||||||
|
lager:debug("[efka_micro_service] terminate with reason: ~p", [Reason]),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
%% @private
|
%% @private
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user