From 2c1af8a208be04a9458639b582d872696767ce80 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Mon, 6 Jul 2026 13:51:01 +0800 Subject: [PATCH] fix config --- apps/efka/src/iot/efka_iot_stream.erl | 7 ++++--- config/sys.config.src | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/efka/src/iot/efka_iot_stream.erl b/apps/efka/src/iot/efka_iot_stream.erl index 60062fd..af8dbed 100644 --- a/apps/efka/src/iot/efka_iot_stream.erl +++ b/apps/efka/src/iot/efka_iot_stream.erl @@ -73,8 +73,7 @@ open_target_socket(Params) when is_map(Params) -> end. -spec stream_target_options(map()) -> error | {ok, #options{}}. -stream_target_options(Params = #{<<"target">> := Target0}) -> - Target = binary_to_atom(Target0), +stream_target_options(Params = #{<<"target">> := Target}) when is_binary(Target) -> {ok, StreamTargets} = application:get_env(efka, stream_targets), case proplists:get_value(Target, StreamTargets, undefined) of undefined -> @@ -90,7 +89,9 @@ stream_target_options(Params = #{<<"target">> := Target0}) -> connect_timeout = maps:get(<<"connect_timeout">>, Params, ConnectTimeout0), idle_timeout = maps:get(<<"idle_timeout">>, Params, IdleTimeout0) }} - end. + end; +stream_target_options(_Params) -> + error. -spec loop(stream_id(), gen_tcp:socket(), timeout()) -> ok. loop(StreamId, Socket, IdleTimeout) -> diff --git a/config/sys.config.src b/config/sys.config.src index be284dd..2ddbf85 100644 --- a/config/sys.config.src +++ b/config/sys.config.src @@ -16,7 +16,7 @@ ]}, {stream_targets, [ - {manager, [ + {<<"manager">>, [ {host, "127.0.0.1"}, {port, 18091}, {connect_timeout, 3000},