Skip to content

Commit

Permalink
Avoid cleanup on bag when disc_only, switch in memory (#1161)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Romain committed Jun 21, 2016
1 parent c91c5aa commit b2f53fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mod_mam_mnesia.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b2f53fb

Please sign in to comment.