From 9bd374e76fee86bd64851e59ef0587016cb456b9 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Fri, 31 Oct 2025 14:56:20 +0800 Subject: [PATCH] fix kafka --- apps/iot/src/endpoint/endpoint_kafka.erl | 8 +------ .../src/http_handlers/container_handler.erl | 23 +------------------ 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/apps/iot/src/endpoint/endpoint_kafka.erl b/apps/iot/src/endpoint/endpoint_kafka.erl index 11e3c2d..aecf5ab 100644 --- a/apps/iot/src/endpoint/endpoint_kafka.erl +++ b/apps/iot/src/endpoint/endpoint_kafka.erl @@ -174,10 +174,4 @@ code_change(_OldVsn, State = #state{}, _Extra) -> %%%=================================================================== retry_connect() -> - erlang:start_timer(?RETRY_INTERVAL, self(), connect). - -check_produce_result(ok) -> - true; -check_produce_result({ok, _}) -> - false. - + erlang:start_timer(?RETRY_INTERVAL, self(), connect). \ No newline at end of file diff --git a/apps/iot/src/http_handlers/container_handler.erl b/apps/iot/src/http_handlers/container_handler.erl index 26bcec6..13e3e79 100644 --- a/apps/iot/src/http_handlers/container_handler.erl +++ b/apps/iot/src/http_handlers/container_handler.erl @@ -161,24 +161,6 @@ handle_request("POST", "/container/remove", _, #{<<"uuid">> := UUID, <<"containe end end; -%handle_request("POST", "/container/task_log", _, #{<<"uuid">> := UUID, <<"task_id">> := TaskId}) when is_binary(UUID), is_integer(TaskId) -> -% case iot_host:get_pid(UUID) of -% undefined -> -% {ok, 200, iot_util:json_error(404, <<"host not found">>)}; -% Pid when is_pid(Pid) -> -% case iot_host:task_log(Pid, TaskId) of -% {ok, Ref} -> -% case iot_host:await_reply(Ref, 5000) of -% {ok, Result} -> -% {ok, 200, iot_util:json_data(Result)}; -% {error, Reason} -> -% {ok, 200, iot_util:json_error(400, Reason)} -% end; -% {error, Reason} when is_binary(Reason) -> -% {ok, 200, iot_util:json_error(400, Reason)} -% end -% end; - handle_request(_, Path, _, _) -> Path1 = list_to_binary(Path), {ok, 200, iot_util:json_error(-1, <<"url: ", Path1/binary, " not found">>)}. @@ -231,10 +213,7 @@ validate_config(Config) when is_map(Config) -> ok; _ -> {error, lists:map(fun erlang:iolist_to_binary/1, Errors)} - end; - -validate_config(_) -> - {error, [<<"Config 必须为 map() 类型">>]}. + end. %%------------------------------------------------------------------------------ %% 校验必选项