fix(ds): make dialyzer happy
This commit is contained in:
parent
4704268727
commit
abf8d8b391
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
-module(emqx_ds_app).
|
-module(emqx_ds_app).
|
||||||
|
|
||||||
|
-dialyzer({nowarn_function, storage/0}).
|
||||||
|
|
||||||
-export([start/2]).
|
-export([start/2]).
|
||||||
|
|
||||||
-include("emqx_ds_int.hrl").
|
-include("emqx_ds_int.hrl").
|
||||||
|
@ -14,20 +16,21 @@ start(_Type, _Args) ->
|
||||||
|
|
||||||
init_mnesia() ->
|
init_mnesia() ->
|
||||||
%% FIXME: This is a temporary workaround to avoid crashes when starting on Windows
|
%% 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(
|
ok = mria:create_table(
|
||||||
?SESSION_TAB,
|
?SESSION_TAB,
|
||||||
[
|
[
|
||||||
{rlog_shard, ?DS_SHARD},
|
{rlog_shard, ?DS_SHARD},
|
||||||
{type, set},
|
{type, set},
|
||||||
{storage, Storage},
|
{storage, storage()},
|
||||||
{record_name, session},
|
{record_name, session},
|
||||||
{attributes, record_info(fields, session)}
|
{attributes, record_info(fields, session)}
|
||||||
]
|
]
|
||||||
).
|
).
|
||||||
|
|
||||||
|
storage() ->
|
||||||
|
case mria:rocksdb_backend_available() of
|
||||||
|
true ->
|
||||||
|
rocksdb_copies;
|
||||||
|
_ ->
|
||||||
|
disc_copies
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue