|
|
@@ -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.
|