From 66fc1bf3b6cab63559fa58a086a1439ecdebfea7 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sun, 11 Feb 2018 12:54:15 +0300 Subject: Remove 'iqdisc' option Since we got rid of all bottle-neck processes and we have a connection pool for every database, the option is no longer needed and in fact is detrimental: in practice what you get is just a bunch of overloaded processes in the IQ handlers pool no matter how much you increase the `iqdisc` value. Given that there are close to zero operators understanding the meaning of the option and, hence, not using it all, it's not simply deprecated but completely removed. The commit also deprecates the following functions: - gen_iq_handler:add_iq_handler/6 - gen_iq_handler:handle/5 - gen_iq_handler:iqdisc/1 --- src/mod_time.erl | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'src/mod_time.erl') diff --git a/src/mod_time.erl b/src/mod_time.erl index d4dffbf1..3ecd0ae4 100644 --- a/src/mod_time.erl +++ b/src/mod_time.erl @@ -33,30 +33,23 @@ -behaviour(gen_mod). -export([start/2, stop/1, reload/3, process_local_iq/1, - mod_opt_type/1, mod_options/1, depends/2]). + mod_options/1, depends/2]). -include("ejabberd.hrl"). -include("logger.hrl"). -include("xmpp.hrl"). -start(Host, Opts) -> - IQDisc = gen_mod:get_opt(iqdisc, Opts), +start(Host, _Opts) -> gen_iq_handler:add_iq_handler(ejabberd_local, Host, - ?NS_TIME, ?MODULE, process_local_iq, IQDisc). + ?NS_TIME, ?MODULE, process_local_iq). stop(Host) -> gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_TIME). -reload(Host, NewOpts, OldOpts) -> - case gen_mod:is_equal_opt(iqdisc, NewOpts, OldOpts) of - {false, IQDisc, _} -> - gen_iq_handler:add_iq_handler(ejabberd_local, Host, ?NS_TIME, - ?MODULE, process_local_iq, IQDisc); - true -> - ok - end. +reload(_Host, _NewOpts, _OldOpts) -> + ok. process_local_iq(#iq{type = set, lang = Lang} = IQ) -> Txt = <<"Value 'set' of 'type' attribute is not allowed">>, @@ -74,7 +67,5 @@ process_local_iq(#iq{type = get} = IQ) -> depends(_Host, _Opts) -> []. -mod_opt_type(iqdisc) -> fun gen_iq_handler:check_type/1. - -mod_options(Host) -> - [{iqdisc, gen_iq_handler:iqdisc(Host)}]. +mod_options(_Host) -> + []. -- cgit v1.2.3