This commit is contained in:
anlicheng 2025-05-05 23:32:02 +08:00
parent dab42088f2
commit 21f8edda02

View File

@ -68,9 +68,9 @@ init([]) ->
%%% Internal functions
%%%===================================================================
-spec register_service(ServiceId :: binary()) -> {ok, Pid :: pid()} | {error, Reason :: any()}.
register_service(ServiceId) when is_binary(ServiceId) ->
case supervisor:start_child(?MODULE, child_spec(ServiceId)) of
-spec register_service(Service :: #micro_service{}) -> {ok, Pid :: pid()} | {error, Reason :: any()}.
register_service(Service) ->
case supervisor:start_child(?MODULE, child_spec(Service)) of
{ok, Pid} when is_pid(Pid) ->
{ok, Pid};
{error, {'already_started', Pid}} when is_pid(Pid) ->