aboutsummaryrefslogtreecommitdiff
path: root/src/mod_ping.erl
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2019-08-04 21:46:18 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2019-08-04 21:46:18 +0300
commit2168489ddf96a88d4b4885a1a0a986acb25754c5 (patch)
tree6eb6aa952467a4b30977d603cd05c6644c259893 /src/mod_ping.erl
parentUse tagged version for yconf as well (diff)
Don't retain module option on gen_mod supervisor
When module's options were updated (e.g. by reloading ejabberd.yml) and, later, the module's process crashed, gen_mod supervisor restarts the process with outdated options. This is now fixed.
Diffstat (limited to 'src/mod_ping.erl')
-rw-r--r--src/mod_ping.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mod_ping.erl b/src/mod_ping.erl
index cacab4106..d4c226e56 100644
--- a/src/mod_ping.erl
+++ b/src/mod_ping.erl
@@ -91,8 +91,9 @@ reload(Host, NewOpts, OldOpts) ->
%%====================================================================
%% gen_server callbacks
%%====================================================================
-init([Host, Opts]) ->
+init([Host|_]) ->
process_flag(trap_exit, true),
+ Opts = gen_mod:get_module_opts(Host, ?MODULE),
State = init_state(Host, Opts),
register_iq_handlers(Host),
case State#state.send_pings of