From 823695aaa0fc8bc285158bc2006f101e82293ccd Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Wed, 17 Sep 2025 11:27:52 +0800 Subject: [PATCH] fix --- apps/efka/src/efka_service_sup.erl | 2 -- apps/efka/src/websocket/ws_channel.erl | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/efka/src/efka_service_sup.erl b/apps/efka/src/efka_service_sup.erl index a516296..bb4b937 100644 --- a/apps/efka/src/efka_service_sup.erl +++ b/apps/efka/src/efka_service_sup.erl @@ -71,8 +71,6 @@ stop_service(ServiceId) when is_binary(ServiceId) -> supervisor:terminate_child(?MODULE, ChildId), supervisor:delete_child(?MODULE, ChildId). -child_spec(#service{service_id = ServiceId}) when is_binary(ServiceId) -> - child_spec(ServiceId); child_spec(ServiceId) when is_binary(ServiceId) -> Name = efka_service:get_name(ServiceId), #{ diff --git a/apps/efka/src/websocket/ws_channel.erl b/apps/efka/src/websocket/ws_channel.erl index 181be76..1f94880 100644 --- a/apps/efka/src/websocket/ws_channel.erl +++ b/apps/efka/src/websocket/ws_channel.erl @@ -109,8 +109,8 @@ terminate(Reason, _Req, State) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 注册, 要建立程序和容器之间的关系 -handle_request(#{<<"id">> := Id, <<"method">> := <<"register">>, <<"params">> := #{<<"container_name">> := ContainerName, <<"meta_tag">> := MetaTag}}, State) -> - case efka_container:get_pid(ContainerName) of +handle_request(#{<<"id">> := Id, <<"method">> := <<"register">>, <<"params">> := #{<<"service_id">> := ServiceId}}, State) -> + case efka_service:get_pid(ServiceId) of undefined -> lager:warning("[ws_channel] container_name: ~p, not running", [ContainerName]), Reply = json_error(Id, -1, <<"container not running">>),