diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2016-06-21 10:43:19 +0200 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2016-06-21 10:43:19 +0200 |
commit | b2f53fb9622f514de49adc11fb034a7019afbe1b (patch) | |
tree | 062f00bb6e60db1198c2dad374521a03ebe3ca93 /src | |
parent | Fix handling of queued stanzas on session timeout (diff) |
Avoid cleanup on bag when disc_only, switch in memory (#1161)
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_mam_mnesia.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mod_mam_mnesia.erl b/src/mod_mam_mnesia.erl index 10b98daf7..2463690fd 100644 --- a/src/mod_mam_mnesia.erl +++ b/src/mod_mam_mnesia.erl @@ -52,7 +52,10 @@ remove_room(_LServer, LName, LHost) -> remove_user(LName, LHost). delete_old_messages(global, TimeStamp, Type) -> - delete_old_user_messages(mnesia:dirty_first(archive_msg), TimeStamp, Type). + mnesia:change_table_copy_type(archive_msg, node(), disc_copies), + Result = delete_old_user_messages(mnesia:dirty_first(archive_msg), TimeStamp, Type), + mnesia:change_table_copy_type(archive_msg, node(), disc_only_copies), + Result. delete_old_user_messages('$end_of_table', _TimeStamp, _Type) -> ok; |