summaryrefslogtreecommitdiff
path: root/src/gm.erl
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2011-04-01 14:27:29 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2011-04-01 14:27:29 +0100
commitcde255cac929da94d8722ca901b0b65876fe72f3 (patch)
tree89c088c0d9f1e2e4fe7534fb62932eaece9d30ff /src/gm.erl
parentff78d574ece961bcafc3efe1fbd235893d8ea28a (diff)
downloadrabbitmq-server-cde255cac929da94d8722ca901b0b65876fe72f3.tar.gz
use mnesia:read/1 instead of read/3
Diffstat (limited to 'src/gm.erl')
-rw-r--r--src/gm.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gm.erl b/src/gm.erl
index aa5ba146..8b7dc70c 100644
--- a/src/gm.erl
+++ b/src/gm.erl
@@ -1011,7 +1011,7 @@ prune_or_create_group(Self, GroupName) ->
fun () -> GroupNew = #gm_group { name = GroupName,
members = [Self],
version = 0 },
- case mnesia:read(?GROUP_TABLE, GroupName, read) of
+ case mnesia:read({?GROUP_TABLE, GroupName}) of
[] ->
mnesia:write(GroupNew),
GroupNew;
@@ -1029,7 +1029,7 @@ record_dead_member_in_group(Member, GroupName) ->
{atomic, Group} =
mnesia:sync_transaction(
fun () -> [Group1 = #gm_group { members = Members, version = Ver }] =
- mnesia:read(?GROUP_TABLE, GroupName, read),
+ mnesia:read({?GROUP_TABLE, GroupName}),
case lists:splitwith(
fun (Member1) -> Member1 =/= Member end, Members) of
{_Members1, []} -> %% not found - already recorded dead
@@ -1049,7 +1049,7 @@ record_new_member_in_group(GroupName, Left, NewMember, Fun) ->
mnesia:sync_transaction(
fun () ->
[#gm_group { members = Members, version = Ver } = Group1] =
- mnesia:read(?GROUP_TABLE, GroupName, read),
+ mnesia:read({?GROUP_TABLE, GroupName}),
{Prefix, [Left | Suffix]} =
lists:splitwith(fun (M) -> M =/= Left end, Members),
Members1 = Prefix ++ [Left, NewMember | Suffix],
@@ -1068,7 +1068,7 @@ erase_members_in_group(Members, GroupName) ->
fun () ->
[Group1 = #gm_group { members = [_|_] = Members1,
version = Ver }] =
- mnesia:read(?GROUP_TABLE, GroupName, read),
+ mnesia:read({?GROUP_TABLE, GroupName}),
case Members1 -- DeadMembers of
Members1 -> Group1;
Members2 -> Group2 =