chore: always init_load config wiht defaults populated

this effectively eliminates the need for raw_with_default
because it's now always set to true everywhere.
will remove it in a followup.
This commit is contained in:
Zaiming (Stone) Shi 2023-04-30 21:24:46 +02:00
parent 475dee32ee
commit 43c80ba635
3 changed files with 1 additions and 9 deletions

View File

@ -489,7 +489,7 @@ load_config(SchemaModule, Config, Opts) ->
ok. ok.
load_config(SchemaModule, Config) -> load_config(SchemaModule, Config) ->
load_config(SchemaModule, Config, #{raw_with_default => false}). load_config(SchemaModule, Config, #{raw_with_default => true}).
-spec is_all_tcp_servers_available(Servers) -> Result when -spec is_all_tcp_servers_available(Servers) -> Result when
Servers :: [{Host, Port}], Servers :: [{Host, Port}],

View File

@ -22,7 +22,6 @@
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
-define(LOGGER, emqx_logger). -define(LOGGER, emqx_logger).
-define(a, "a").
-define(SUPPORTED_LEVELS, [emergency, alert, critical, error, warning, notice, info, debug]). -define(SUPPORTED_LEVELS, [emergency, alert, critical, error, warning, notice, info, debug]).
all() -> emqx_common_test_helpers:all(?MODULE). all() -> emqx_common_test_helpers:all(?MODULE).

View File

@ -88,15 +88,8 @@ sync_data_from_node() ->
%% Internal functions %% Internal functions
%% ------------------------------------------------------------------------------ %% ------------------------------------------------------------------------------
-ifdef(TEST).
init_load() ->
emqx_config:init_load(emqx_conf:schema_module(), #{raw_with_default => false}).
-else.
init_load() -> init_load() ->
emqx_config:init_load(emqx_conf:schema_module(), #{raw_with_default => true}). emqx_config:init_load(emqx_conf:schema_module(), #{raw_with_default => true}).
-endif.
init_conf() -> init_conf() ->
%% Workaround for https://github.com/emqx/mria/issues/94: %% Workaround for https://github.com/emqx/mria/issues/94: