From d4cd3ddc3248ca5b9ea3527d4c70837e1d76cab1 Mon Sep 17 00:00:00 2001 From: Stu Tomlinson Date: Mon, 19 Nov 2018 15:11:33 +0000 Subject: [PATCH] Add ejabberd_stopping hook This hook allows modules to detect when ejabberd is stopping and adjust behaviour if desired --- src/ejabberd_app.erl | 1 + 1 file changed, 1 insertion(+) 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(),