Document and example of pre_uninstall/0 (processone/ejabberd#3548)
This commit is contained in:
parent
4cde5d84f2
commit
2aea4659cc
|
@ -64,3 +64,7 @@ The following organization has been set up for the development:
|
||||||
|
|
||||||
- Module developers should note in the `README.txt` file whether the
|
- Module developers should note in the `README.txt` file whether the
|
||||||
module has requirements or known incompatibilities with other modules.
|
module has requirements or known incompatibilities with other modules.
|
||||||
|
|
||||||
|
- If your module project contains several erlang modules, you should export a
|
||||||
|
function pre_uninstall/0 in the main one listing the other ones.
|
||||||
|
See mod_statsdx as an example.
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
-export([start/2, stop/1, depends/2, mod_opt_type/1, mod_options/1]).
|
-export([start/2, stop/1, depends/2, mod_opt_type/1, mod_options/1]).
|
||||||
-export([loop/1, get_statistic/2,
|
-export([loop/1, get_statistic/2,
|
||||||
|
pre_uninstall/0,
|
||||||
received_response/3,
|
received_response/3,
|
||||||
%% Commands
|
%% Commands
|
||||||
getstatsdx/1, getstatsdx/2,
|
getstatsdx/1, getstatsdx/2,
|
||||||
|
@ -79,6 +80,10 @@ stop(Host) ->
|
||||||
_ -> ?PROCNAME ! {stop, Host}
|
_ -> ?PROCNAME ! {stop, Host}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
pre_uninstall() ->
|
||||||
|
[{code:purge(M), code:delete(M)}
|
||||||
|
|| M <- [mod_stats2file]].
|
||||||
|
|
||||||
depends(_Host, _Opts) ->
|
depends(_Host, _Opts) ->
|
||||||
[].
|
[].
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue