From: Christophe Romain Date: Mon, 3 Apr 2017 10:13:03 +0000 (+0200) Subject: Always init pubsub_index when using mnesia X-Git-Tag: 17.04~19^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b75780b9cd588d540545243e0ed11a81ce9b7db0;p=ejabberd Always init pubsub_index when using mnesia --- diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 5dbd75859..d530dc985 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -256,6 +256,10 @@ init([ServerHost, Opts]) -> fun(A) when is_integer(A) andalso A >= 0 -> A end, ?MAXITEMS), MaxSubsNode = gen_mod:get_opt(max_subscriptions_node, Opts, fun(A) when is_integer(A) andalso A >= 0 -> A end, undefined), + case gen_mod:db_type(ServerHost, ?MODULE) of + mnesia -> pubsub_index:init(Host, ServerHost, Opts); + _ -> ok + end, {Plugins, NodeTree, PepMapping} = init_plugins(Host, ServerHost, Opts), DefaultModule = plugin(Host, hd(Plugins)), BaseOptions = DefaultModule:options(),