mirror of
https://github.com/processone/ejabberd.git
synced 2024-10-07 14:58:56 +02:00
* src/mod_private.erl: Reduce memory consumption on user private storage removal (EJAB-299).
SVN Revision: 852
This commit is contained in:
parent
442dd0667b
commit
a1481f27aa
@ -1,3 +1,8 @@
|
||||
2007-08-01 Mickael Remond <mickael.remond@process-one.net>
|
||||
|
||||
* src/mod_private.erl: Reduce memory consumption on user private
|
||||
storage removal (EJAB-299).
|
||||
|
||||
2007-07-31 Mickael Remond <mickael.remond@process-one.net>
|
||||
|
||||
* src/xml.erl: Making use of CDATA escaping optional through with
|
||||
|
@ -107,21 +107,21 @@ get_data(LUser, LServer, [El | Els], Res) ->
|
||||
get_data(LUser, LServer, Els, Res)
|
||||
end.
|
||||
|
||||
|
||||
% TODO: use mnesia:select
|
||||
remove_user(User, Server) ->
|
||||
LUser = jlib:nodeprep(User),
|
||||
LServer = jlib:nameprep(Server),
|
||||
F = fun() ->
|
||||
Namespaces = mnesia:select(
|
||||
private_storage,
|
||||
[{#private_storage{usns={LUser, LServer, '$1'},
|
||||
_ = '_'},
|
||||
[],
|
||||
['$$']}]),
|
||||
lists:foreach(
|
||||
fun({U, S, _} = Key) ->
|
||||
if
|
||||
(U == LUser) and (S == LServer) ->
|
||||
mnesia:delete({private_storage, Key});
|
||||
true ->
|
||||
ok
|
||||
end
|
||||
end, mnesia:all_keys(private_storage))
|
||||
fun([Namespace]) ->
|
||||
mnesia:delete({private_storage,
|
||||
{LUser, LServer, Namespace}})
|
||||
end, Namespaces)
|
||||
end,
|
||||
mnesia:transaction(F).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user