Przeglądaj źródła

Merge pull request #14116 from HJianBo/fix-default-val-not-working

fix: the default values of retainer schema do not take effect
JianBo He 1 rok temu
rodzic
commit
5dc0dc4922
2 zmienionych plików z 6 dodań i 0 usunięć
  1. 5 0
      apps/emqx/src/emqx_config.erl
  2. 1 0
      changes/ce/fix-14116.en.md

+ 5 - 0
apps/emqx/src/emqx_config.erl

@@ -397,8 +397,13 @@ fill_defaults_for_all_roots(SchemaMod, RawConf0) ->
 %% e.g. when testing an app, we need to load its config first
 %% then start emqx_conf application which will load the
 %% possibly empty config again (then filled with defaults).
+-ifdef(TEST).
 is_already_loaded(Name) ->
     ?MODULE:get_raw([Name], #{}) =/= #{}.
+-else.
+is_already_loaded(_) ->
+    false.
+-endif.
 
 %% if a root is not found in the raw conf, fill it with default values.
 seed_default(Schema) ->

+ 1 - 0
changes/ce/fix-14116.en.md

@@ -0,0 +1 @@
+Fix an issue where the default configuration of retainer is generated incorrectly after joining a cluster