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.
-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) ->

View File

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