24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-10 21:47:01 +02:00

Add ejabberd_stopping hook

This hook allows modules to detect when ejabberd is stopping and adjust
behaviour if desired
This commit is contained in:
Stu Tomlinson 2018-11-19 15:11:33 +00:00
parent 1214a83cca
commit d4cd3ddc32

View File

@ -77,6 +77,7 @@ start(_, _) ->
%% This function is called when an application is about to be stopped, %% This function is called when an application is about to be stopped,
%% before shutting down the processes of the application. %% before shutting down the processes of the application.
prep_stop(State) -> prep_stop(State) ->
ejabberd_hooks:run(ejabberd_stopping, []),
ejabberd_listener:stop_listeners(), ejabberd_listener:stop_listeners(),
ejabberd_sm:stop(), ejabberd_sm:stop(),
gen_mod:stop_modules(), gen_mod:stop_modules(),