diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-02-11 12:54:15 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-02-11 12:54:15 +0300 |
commit | 66fc1bf3b6cab63559fa58a086a1439ecdebfea7 (patch) | |
tree | cdc0ce2d21249f31060a1c302e4708abc507d10e /src/mod_time.erl | |
parent | Bump xmpp version (diff) |
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
Diffstat (limited to 'src/mod_time.erl')
-rw-r--r-- | src/mod_time.erl | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/mod_time.erl b/src/mod_time.erl index d4dffbf10..3ecd0ae47 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) -> + []. |