mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-14 22:00:16 +02:00
Fix session table cleanup
This commit is contained in:
parent
cf67b9ec54
commit
8639da0e00
|
@ -111,12 +111,18 @@ handle_cast(_Msg, State) ->
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
||||||
handle_info({mnesia_system_event, {mnesia_down, Node}}, State) ->
|
handle_info({mnesia_system_event, {mnesia_down, Node}}, State) ->
|
||||||
ets:select_delete(
|
Sessions =
|
||||||
session,
|
ets:select(
|
||||||
ets:fun2ms(
|
session,
|
||||||
fun(#session{sid = {_, Pid}}) ->
|
ets:fun2ms(
|
||||||
node(Pid) == Node
|
fun(#session{sid = {_, Pid}} = S)
|
||||||
end)),
|
when node(Pid) == Node ->
|
||||||
|
S
|
||||||
|
end)),
|
||||||
|
lists:foreach(
|
||||||
|
fun(S) ->
|
||||||
|
mnesia:dirty_delete_object(S)
|
||||||
|
end, Sessions),
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
handle_info(_Info, State) ->
|
handle_info(_Info, State) ->
|
||||||
{noreply, State}.
|
{noreply, State}.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user