fix(plugin): schema content only provided in enterprise edition

This commit is contained in:
JimMoen 2024-05-20 11:06:02 +08:00
parent a7f2f95318
commit 140b7ce51e
No known key found for this signature in database
1 changed files with 9 additions and 4 deletions

View File

@ -695,10 +695,15 @@ aggregate_status([{Node, Plugins} | List], Acc) ->
aggregate_status(List, NewAcc). aggregate_status(List, NewAcc).
format_plugin_avsc_and_i18n(NameVsn) -> format_plugin_avsc_and_i18n(NameVsn) ->
#{ case emqx_release:edition() of
avsc => try_read_file(fun() -> emqx_plugins:plugin_avsc(NameVsn) end), ee ->
i18n => try_read_file(fun() -> emqx_plugins:plugin_i18n(NameVsn) end) #{
}. avsc => try_read_file(fun() -> emqx_plugins:plugin_avsc(NameVsn) end),
i18n => try_read_file(fun() -> emqx_plugins:plugin_i18n(NameVsn) end)
};
ce ->
#{avsc => null, i18n => null}
end.
try_read_file(Fun) -> try_read_file(Fun) ->
case Fun() of case Fun() of