mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
* src/ejabberd_router.erl: Added monitoring of processess that
serve domains SVN Revision: 197
This commit is contained in:
parent
7f9b7e64c3
commit
41cc38aa6f
@ -1,5 +1,8 @@
|
|||||||
2004-01-06 Alexey Shchepin <alexey@sevcom.net>
|
2004-01-06 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
|
* src/ejabberd_router.erl: Added monitoring of processess that
|
||||||
|
serve domains
|
||||||
|
|
||||||
* src/ejabberd_app.erl: Bugfix
|
* src/ejabberd_app.erl: Bugfix
|
||||||
|
|
||||||
2004-01-03 Alexey Shchepin <alexey@sevcom.net>
|
2004-01-03 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
@ -38,6 +38,7 @@ init() ->
|
|||||||
{attributes,
|
{attributes,
|
||||||
record_info(fields, route)}]),
|
record_info(fields, route)}]),
|
||||||
mnesia:add_table_copy(route, node(), ram_copies),
|
mnesia:add_table_copy(route, node(), ram_copies),
|
||||||
|
mnesia:subscribe({table, route, simple}),
|
||||||
loop().
|
loop().
|
||||||
|
|
||||||
loop() ->
|
loop() ->
|
||||||
@ -65,6 +66,22 @@ loop() ->
|
|||||||
end,
|
end,
|
||||||
mnesia:transaction(F),
|
mnesia:transaction(F),
|
||||||
loop();
|
loop();
|
||||||
|
{mnesia_table_event, {write, #route{pid = Pid}, _ActivityId}} ->
|
||||||
|
erlang:monitor(process, Pid),
|
||||||
|
loop();
|
||||||
|
{'DOWN', _Ref, _Type, Pid, _Info} ->
|
||||||
|
F = fun() ->
|
||||||
|
Es = mnesia:select(
|
||||||
|
route,
|
||||||
|
[{#route{pid = Pid, _ = '_'},
|
||||||
|
[],
|
||||||
|
['$_']}]),
|
||||||
|
lists:foreach(fun(E) ->
|
||||||
|
mnesia:delete_object(E)
|
||||||
|
end, Es)
|
||||||
|
end,
|
||||||
|
mnesia:transaction(F),
|
||||||
|
loop();
|
||||||
_ ->
|
_ ->
|
||||||
loop()
|
loop()
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user