refactor: use emqx_utils_ets for ets table creation

This commit is contained in:
Zaiming (Stone) Shi 2023-04-18 19:59:23 +02:00
parent 34afa16236
commit ceafc52ad6
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ init() ->
OtherLangDesc0 = filelib:wildcard("desc.*.hocon", WwwStaticDir),
OtherLangDesc = lists:map(fun(F) -> filename:join([WwwStaticDir, F]) end, OtherLangDesc0),
Files = [EngDesc | OtherLangDesc],
?MODULE = ets:new(?MODULE, [named_table, public, set, {read_concurrency, true}]),
ok = emqx_utils_ets:new(?MODULE, [public, ordered_set, {read_concurrency, true}]),
ok = lists:foreach(fun(F) -> load_desc(?MODULE, F) end, Files).
%% @doc Load the description of the configuration items from the file.

View File

@ -117,7 +117,7 @@ merge_desc_files_per_lang(Lang) ->
"zh" ->
%% so far we inject zh desc as if it's extracted from dashboard package
%% TODO: remove this when we have zh translation moved to dashboard package
"apps/emqx_dashboard/priv/www/static/desc.zh.hocon"
"apps/emqx_dashboard/priv/www/static/desc.zh.hocon"
end,
ok = filelib:ensure_dir(OutputFile),
ok = file:write_file(OutputFile, Conf).