Fix host/port config lookup for 'local' scenarios

This commit is contained in:
Ulf Wiger
2026-08-03 10:44:16 +02:00
parent 450c851be6
commit df438b3871
2 changed files with 8 additions and 3 deletions
+2
View File
@@ -318,6 +318,8 @@ eureka_get_host_port() ->
try_noise_connect(Opts) ->
%% Defaults from user/schema config; Eureka (or pool_admin.url = <<"local">>)
%% values in Opts override them via maps:merge/2.
Host = binary_to_list(gmhc_config:get_config([<<"pool">>, <<"host">>])),
Port = gmhc_config:get_config([<<"pool">>, <<"port">>]),
noise_connect(maps:merge(#{host => Host, port => Port}, Opts)).
+6 -3
View File
@@ -127,9 +127,12 @@ get_pool_address_() ->
{ok, URL0} ->
case expand_url(URL0) of
<<"local">> ->
{ok, #{host => <<"127.0.0.1">>,
port => gmconfig:get_config(
[<<"pool">>, <<"port">>], [schema_default]),
%% Skip Eureka HTTP; use pool.{host,port,id} from user config
%% (via gmhc_config: user_config then schema_default). Do not
%% use gmconfig(..., [schema_default]) alone — that ignores
%% explicit CT/user pool.port / pool.host.
{ok, #{host => gmhc_config:get_config([<<"pool">>, <<"host">>]),
port => gmhc_config:get_config([<<"pool">>, <<"port">>]),
pool_id => gmhc_config:get_config([<<"pool">>, <<"id">>]) }};
URL ->
?LOG_INFO("Trying to connect to ~p", [URL]),