fix config

This commit is contained in:
anlicheng 2026-07-06 13:51:01 +08:00
parent 8f801fd29c
commit 2c1af8a208
2 changed files with 5 additions and 4 deletions

View File

@ -73,8 +73,7 @@ open_target_socket(Params) when is_map(Params) ->
end. end.
-spec stream_target_options(map()) -> error | {ok, #options{}}. -spec stream_target_options(map()) -> error | {ok, #options{}}.
stream_target_options(Params = #{<<"target">> := Target0}) -> stream_target_options(Params = #{<<"target">> := Target}) when is_binary(Target) ->
Target = binary_to_atom(Target0),
{ok, StreamTargets} = application:get_env(efka, stream_targets), {ok, StreamTargets} = application:get_env(efka, stream_targets),
case proplists:get_value(Target, StreamTargets, undefined) of case proplists:get_value(Target, StreamTargets, undefined) of
undefined -> undefined ->
@ -90,7 +89,9 @@ stream_target_options(Params = #{<<"target">> := Target0}) ->
connect_timeout = maps:get(<<"connect_timeout">>, Params, ConnectTimeout0), connect_timeout = maps:get(<<"connect_timeout">>, Params, ConnectTimeout0),
idle_timeout = maps:get(<<"idle_timeout">>, Params, IdleTimeout0) idle_timeout = maps:get(<<"idle_timeout">>, Params, IdleTimeout0)
}} }}
end. end;
stream_target_options(_Params) ->
error.
-spec loop(stream_id(), gen_tcp:socket(), timeout()) -> ok. -spec loop(stream_id(), gen_tcp:socket(), timeout()) -> ok.
loop(StreamId, Socket, IdleTimeout) -> loop(StreamId, Socket, IdleTimeout) ->

View File

@ -16,7 +16,7 @@
]}, ]},
{stream_targets, [ {stream_targets, [
{manager, [ {<<"manager">>, [
{host, "127.0.0.1"}, {host, "127.0.0.1"},
{port, 18091}, {port, 18091},
{connect_timeout, 3000}, {connect_timeout, 3000},