fix service

This commit is contained in:
anlicheng 2025-05-05 23:13:59 +08:00
parent b18a96b185
commit 469725d502

View File

@ -22,7 +22,7 @@
-export_type([manifest/0]). -export_type([manifest/0]).
%% API %% API
-export([new/1, startup/1, kill_os_pid/1]). -export([new/1, startup/1]).
-spec new(WorkDir0 :: binary()) -> {ok, #manifest{}} | {error, Reason :: binary()}. -spec new(WorkDir0 :: binary()) -> {ok, #manifest{}} | {error, Reason :: binary()}.
new(WorkDir0) when is_binary(WorkDir0) -> new(WorkDir0) when is_binary(WorkDir0) ->
@ -63,14 +63,14 @@ check_manifest(_Manifest) ->
check_manifest0([], _Settings, Manifest) -> check_manifest0([], _Settings, Manifest) ->
{ok, Manifest}; {ok, Manifest};
check_manifest0([<<"serivce_id">>|T], Settings, Manifest) -> check_manifest0([<<"service_id">>|T], Settings, Manifest) ->
case maps:find(<<"serivce_id">>, Settings) of case maps:find(<<"serivce_id">>, Settings) of
error -> error ->
{error, <<"miss serivce_id">>}; {error, <<"miss service_id">>};
{ok, ServiceId} when is_binary(ServiceId) -> {ok, ServiceId} when is_binary(ServiceId) ->
check_manifest0(T, Settings, Manifest#manifest{service_id = ServiceId}); check_manifest0(T, Settings, Manifest#manifest{service_id = ServiceId});
{ok, _} -> {ok, _} ->
{error, <<"serivce_id is not string">>} {error, <<"service_id is not string">>}
end; end;
check_manifest0([<<"health_check">>|T], Settings, Manifest) -> check_manifest0([<<"health_check">>|T], Settings, Manifest) ->
case maps:find(<<"health_check">>, Settings) of case maps:find(<<"health_check">>, Settings) of