25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Better Riak usage detection

This commit is contained in:
Evgeniy Khramtsov 2014-07-15 20:26:32 +04:00
parent b5f1b17926
commit 4ef0dd6997

View File

@ -68,6 +68,9 @@ is_riak_configured(Host) ->
PortConfigured = ejabberd_config:get_option(
{riak_port, Host},
fun(_) -> true end, false),
AuthConfigured = lists:member(
ejabberd_auth_riak,
ejabberd_auth:auth_modules(Host)),
Modules = ejabberd_config:get_option(
{modules, Host},
fun(L) when is_list(L) -> L end, []),
@ -75,7 +78,8 @@ is_riak_configured(Host) ->
fun({_Module, Opts}) ->
gen_mod:db_type(Opts) == riak
end, Modules),
ServerConfigured or PortConfigured or ModuleWithRiakDBConfigured.
ServerConfigured or PortConfigured
or AuthConfigured or ModuleWithRiakDBConfigured.
do_start() ->
SupervisorName = ?MODULE,