fix(ds): Abort application startup when rocksdb is not avialable
This commit is contained in:
parent
3d823beb11
commit
3165b4f645
|
@ -440,12 +440,6 @@ del_subscription(TopicFilter, DSSessionId) ->
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
create_tables() ->
|
create_tables() ->
|
||||||
ok = emqx_ds:open_db(?PERSISTENT_MESSAGE_DB, #{
|
|
||||||
backend => builtin,
|
|
||||||
storage => {emqx_ds_storage_bitfield_lts, #{}},
|
|
||||||
n_shards => 16,
|
|
||||||
replication_factor => 3
|
|
||||||
}),
|
|
||||||
ok = mria:create_table(
|
ok = mria:create_table(
|
||||||
?SESSION_TAB,
|
?SESSION_TAB,
|
||||||
[
|
[
|
||||||
|
|
|
@ -29,8 +29,15 @@ start_link() ->
|
||||||
%% behaviour callbacks
|
%% behaviour callbacks
|
||||||
%%================================================================================
|
%%================================================================================
|
||||||
|
|
||||||
|
-dialyzer({nowarn_function, init/1}).
|
||||||
init([]) ->
|
init([]) ->
|
||||||
Children = [meta(), storage_layer_sup()],
|
%% TODO: technically, we don't need rocksDB for the alternative
|
||||||
|
%% backends. But right now we have any:
|
||||||
|
Children =
|
||||||
|
case mria:rocksdb_backend_available() of
|
||||||
|
true -> [meta(), storage_layer_sup()];
|
||||||
|
false -> []
|
||||||
|
end,
|
||||||
SupFlags = #{
|
SupFlags = #{
|
||||||
strategy => one_for_all,
|
strategy => one_for_all,
|
||||||
intensity => 0,
|
intensity => 0,
|
||||||
|
|
Loading…
Reference in New Issue