fix
This commit is contained in:
parent
22b4e9e9de
commit
9d4556a97e
@ -105,16 +105,8 @@ handle_cast(deploy, State = #state{task_id = TaskId, root_dir = RootDir, service
|
|||||||
%% 状态: 0: 停止, 1: 运行中
|
%% 状态: 0: 停止, 1: 运行中
|
||||||
status = 0
|
status = 0
|
||||||
}),
|
}),
|
||||||
|
efka_agent:feedback_phase(TaskId, efka_util:timestamp(), <<"deploy success">>),
|
||||||
%% 正常启动服务
|
{stop, normal, State};
|
||||||
case boot_service(ServiceId) of
|
|
||||||
{ok, Pid} when is_pid(Pid) ->
|
|
||||||
efka_agent:feedback_phase(TaskId, efka_util:timestamp(), <<"boot success">>),
|
|
||||||
{stop, normal, State};
|
|
||||||
{error, Reason} ->
|
|
||||||
efka_agent:feedback_phase(TaskId, efka_util:timestamp(), <<"boot failed">>),
|
|
||||||
{stop, {error, Reason}, State}
|
|
||||||
end;
|
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
efka_agent:feedback_phase(TaskId, efka_util:timestamp(), <<"tar decompression error">>),
|
efka_agent:feedback_phase(TaskId, efka_util:timestamp(), <<"tar decompression error">>),
|
||||||
{stop, {error, Reason}, State}
|
{stop, {error, Reason}, State}
|
||||||
@ -238,16 +230,6 @@ check_download_url(Url) when is_list(Url) ->
|
|||||||
{error, Reason}
|
{error, Reason}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec boot_service(ServiceId :: binary()) -> {ok, Pid :: pid()} | {error, Reason :: any()}.
|
|
||||||
boot_service(ServiceId) ->
|
|
||||||
%% 正常启动服务
|
|
||||||
case efka_micro_service:get_pid(ServiceId) of
|
|
||||||
undefined ->
|
|
||||||
efka_micro_service_sup:start_service(ServiceId);
|
|
||||||
Pid ->
|
|
||||||
{ok, Pid}
|
|
||||||
end.
|
|
||||||
|
|
||||||
%% 解压文件到指定目录
|
%% 解压文件到指定目录
|
||||||
-spec tar_extract(TarFile :: string(), TargetDir :: string()) -> ok | {error, Reason :: term()}.
|
-spec tar_extract(TarFile :: string(), TargetDir :: string()) -> ok | {error, Reason :: term()}.
|
||||||
tar_extract(TarFile, TargetDir) when is_list(TarFile), is_list(TargetDir) ->
|
tar_extract(TarFile, TargetDir) when is_list(TarFile), is_list(TargetDir) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user