mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Stop all s2s connections via supervisor calls
This commit is contained in:
parent
f4081a363b
commit
0542c65a07
@ -595,14 +595,18 @@ supervisor_count(Supervisor) ->
|
|||||||
length(Result)
|
length(Result)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
-spec stop_all_connections() -> ok.
|
||||||
stop_all_connections() ->
|
stop_all_connections() ->
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({_Id, Pid, _Type, _Module}) ->
|
fun({_Id, Pid, _Type, _Module}) ->
|
||||||
exit(Pid, kill)
|
supervisor:terminate_child(ejabberd_s2s_in_sup, Pid)
|
||||||
end,
|
end, supervisor:which_children(ejabberd_s2s_in_sup)),
|
||||||
supervisor:which_children(ejabberd_s2s_in_sup) ++
|
lists:foreach(
|
||||||
supervisor:which_children(ejabberd_s2s_out_sup)),
|
fun({_Id, Pid, _Type, _Module}) ->
|
||||||
mnesia:clear_table(s2s).
|
supervisor:terminate_child(ejabberd_s2s_out_sup, Pid)
|
||||||
|
end, supervisor:which_children(ejabberd_s2s_out_sup)),
|
||||||
|
mnesia:clear_table(s2s),
|
||||||
|
ok.
|
||||||
|
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% Update Mnesia tables
|
%%% Update Mnesia tables
|
||||||
|
Loading…
Reference in New Issue
Block a user