From 21f8edda02cd2600e0f5cad9f2d565e36a271b03 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Mon, 5 May 2025 23:32:02 +0800 Subject: [PATCH] fix sup --- apps/efka/src/efka_micro_service_sup.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/efka/src/efka_micro_service_sup.erl b/apps/efka/src/efka_micro_service_sup.erl index 70963fe..b003989 100644 --- a/apps/efka/src/efka_micro_service_sup.erl +++ b/apps/efka/src/efka_micro_service_sup.erl @@ -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) ->