Просмотр исходного кода

Merge pull request #13503 from thalesmg/20240722-r57-resource-manager-hc-interval-startup

fix(connector resource): use configuration `resource_opts` for health check interval when starting up
Thales Macedo Garitezi 1 год назад
Родитель
Сommit
9e65e0d048
2 измененных файлов с 5 добавлено и 2 удалено
  1. 4 2
      apps/emqx_connector/src/emqx_connector_resource.erl
  2. 1 0
      changes/ce/fix-13503.en.md

+ 4 - 2
apps/emqx_connector/src/emqx_connector_resource.erl

@@ -352,8 +352,10 @@ safe_atom(Bin) when is_binary(Bin) -> binary_to_existing_atom(Bin, utf8);
 safe_atom(Atom) when is_atom(Atom) -> Atom.
 
 parse_opts(Conf, Opts0) ->
-    Opts1 = override_start_after_created(Conf, Opts0),
-    set_no_buffer_workers(Opts1).
+    Opts1 = emqx_resource:fetch_creation_opts(Conf),
+    Opts2 = maps:merge(Opts1, Opts0),
+    Opts = override_start_after_created(Conf, Opts2),
+    set_no_buffer_workers(Opts).
 
 override_start_after_created(Config, Opts) ->
     Enabled = maps:get(enable, Config, true),

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

@@ -0,0 +1 @@
+Fixed an issue where a connector wouldn't respect the configured health check interval when first starting up, and would need an update/restart for the correct value to take effect.