fix(ds): make dialyzer happy

This commit is contained in:
firest 2023-07-26 16:35:07 +08:00
parent 4704268727
commit abf8d8b391
1 changed files with 11 additions and 8 deletions

View File

@ -4,6 +4,8 @@
-module(emqx_ds_app).
-dialyzer({nowarn_function, storage/0}).
-export([start/2]).
-include("emqx_ds_int.hrl").
@ -14,20 +16,21 @@ start(_Type, _Args) ->
init_mnesia() ->
%% FIXME: This is a temporary workaround to avoid crashes when starting on Windows
Storage =
case mria:rocksdb_backend_available() of
true ->
rocksdb_copies;
_ ->
disc_copies
end,
ok = mria:create_table(
?SESSION_TAB,
[
{rlog_shard, ?DS_SHARD},
{type, set},
{storage, Storage},
{storage, storage()},
{record_name, session},
{attributes, record_info(fields, session)}
]
).
storage() ->
case mria:rocksdb_backend_available() of
true ->
rocksdb_copies;
_ ->
disc_copies
end.