From: Stu Tomlinson Date: Mon, 19 Nov 2018 15:11:33 +0000 (+0000) Subject: Add ejabberd_stopping hook X-Git-Tag: 18.12~36^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4cd3ddc3248ca5b9ea3527d4c70837e1d76cab1;p=ejabberd Add ejabberd_stopping hook This hook allows modules to detect when ejabberd is stopping and adjust behaviour if desired --- diff --git a/src/ejabberd_app.erl b/src/ejabberd_app.erl index 3cdab80fe..9bffbae35 100644 --- a/src/ejabberd_app.erl +++ b/src/ejabberd_app.erl @@ -77,6 +77,7 @@ start(_, _) -> %% This function is called when an application is about to be stopped, %% before shutting down the processes of the application. prep_stop(State) -> + ejabberd_hooks:run(ejabberd_stopping, []), ejabberd_listener:stop_listeners(), ejabberd_sm:stop(), gen_mod:stop_modules(),