fix service

This commit is contained in:
anlicheng 2025-05-19 23:39:51 +08:00
parent a4af3af2e4
commit c6e1056f44

View File

@ -26,23 +26,17 @@
%% gen_server callbacks %% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([test/0, test1/0]).
-record(state, { -record(state, {
service_id :: binary(), service_id :: binary(),
%% id信息 %% id信息
channel_pid :: pid() | undefined, channel_pid :: pid() | undefined,
%% port信息, OSPid = erlang:port_info(Port, os_pid) %% port信息, OSPid = erlang:port_info(Port, os_pid)
port :: undefined | port(), port :: undefined | port(),
%% pid %% pid
os_pid :: undefined | integer(), os_pid :: undefined | integer(),
%% %%
manifest :: undefined | efka_manifest:manifest(), manifest :: undefined | efka_manifest:manifest(),
inflight = #{}, inflight = #{},
%% %%
running_status = ?STATUS_STOPPED running_status = ?STATUS_STOPPED
}). }).
@ -51,14 +45,6 @@
%%% API %%% API
%%%=================================================================== %%%===================================================================
test() ->
Pid = get_pid(<<"test1234">>),
stop_service(Pid).
test1() ->
Pid = get_pid(<<"test1234">>),
start_service(Pid).
-spec get_name(ServiceId :: binary()) -> atom(). -spec get_name(ServiceId :: binary()) -> atom().
get_name(ServiceId) when is_binary(ServiceId) -> get_name(ServiceId) when is_binary(ServiceId) ->
list_to_atom("efka_service:" ++ binary_to_list(ServiceId)). list_to_atom("efka_service:" ++ binary_to_list(ServiceId)).