mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Get next record before deleting previous on, in case it's last one (#2069)
This commit is contained in:
parent
8028a9545a
commit
e4054aab79
@ -91,10 +91,10 @@ delete_old_user_messages(User, TimeStamp, Type) ->
|
|||||||
ok
|
ok
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
NextRecord = mnesia:dirty_next(archive_msg, User),
|
||||||
case mnesia:transaction(F) of
|
case mnesia:transaction(F) of
|
||||||
{atomic, ok} ->
|
{atomic, ok} ->
|
||||||
delete_old_user_messages(mnesia:dirty_next(archive_msg, User),
|
delete_old_user_messages(NextRecord, TimeStamp, Type);
|
||||||
TimeStamp, Type);
|
|
||||||
{aborted, Err} ->
|
{aborted, Err} ->
|
||||||
?ERROR_MSG("Cannot delete old MAM messages: ~s", [Err]),
|
?ERROR_MSG("Cannot delete old MAM messages: ~s", [Err]),
|
||||||
Err
|
Err
|
||||||
|
Loading…
Reference in New Issue
Block a user