From 81d364a97a5f3e86efef81fdc39cc0c3208212fb Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Tue, 13 Jul 2010 22:09:48 +0200 Subject: [PATCH] Make chat room destroy and create being sync_dirty to limit mnesia overload. (thanks to Mickael Remond) --- src/mod_muc/mod_muc.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod_muc/mod_muc.erl b/src/mod_muc/mod_muc.erl index 8aee57066..7a0daf23a 100644 --- a/src/mod_muc/mod_muc.erl +++ b/src/mod_muc/mod_muc.erl @@ -308,7 +308,7 @@ handle_info({room_destroyed, RoomHost, Pid}, State) -> mnesia:delete_object(#muc_online_room{name_host = RoomHost, pid = Pid}) end, - mnesia:async_dirty(F), + mnesia:sync_dirty(F), {noreply, State}; handle_info(_Info, State) -> {noreply, State}. @@ -585,7 +585,7 @@ register_room(Host, Room, Pid) when is_binary(Host), is_binary(Room) -> mnesia:write(#muc_online_room{name_host = {Room, Host}, pid = Pid}) end, - mnesia:async_dirty(F). + mnesia:sync_dirty(F). iq_disco_info(Lang) ->