fix(plugin): serde not found on new-joined nodes

This commit is contained in:
JimMoen 2024-05-16 17:31:02 +08:00
parent 4bc80ee483
commit e8d4e88118
No known key found for this signature in database
2 changed files with 4 additions and 6 deletions

View File

@ -27,8 +27,8 @@
start(_Type, _Args) ->
%% load all pre-configured
ok = emqx_plugins:ensure_started(),
{ok, Sup} = emqx_plugins_sup:start_link(),
ok = emqx_plugins:ensure_started(),
ok = emqx_config_handler:add_handler([?CONF_ROOT], emqx_plugins),
{ok, Sup}.

View File

@ -33,7 +33,6 @@
init/1,
handle_call/3,
handle_cast/2,
handle_continue/2,
terminate/2
]).
@ -126,11 +125,10 @@ init(_) ->
]),
State = #{},
AvscPaths = get_plugin_avscs(),
{ok, State, {continue, {build_serdes, AvscPaths}}}.
handle_continue({build_serdes, AvscPaths}, State) ->
%% force build all schemas at startup
%% otherwise plugin schema may not be available when needed
_ = build_serdes(AvscPaths),
{noreply, State}.
{ok, State}.
handle_call({build_serdes, NameVsn, AvscPath}, _From, State) ->
BuildRes = do_build_serde({NameVsn, AvscPath}),