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() ->
|
||||
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(
|
||||
?SESSION_TAB,
|
||||
[
|
||||
|
|
|
@ -29,8 +29,15 @@ start_link() ->
|
|||
%% behaviour callbacks
|
||||
%%================================================================================
|
||||
|
||||
-dialyzer({nowarn_function, init/1}).
|
||||
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 = #{
|
||||
strategy => one_for_all,
|
||||
intensity => 0,
|
||||
|
|
Loading…
Reference in New Issue