Skip to content

Commit

Permalink
pick up custom backend_types, if supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Wiger committed Apr 1, 2011
1 parent 5b4a2df commit 166a81e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions rebar.config
@@ -1,3 +1,8 @@
%% -*- erlang -*-
{erl_opts, [debug_info]}.
{deps, [{edown, ".*", {git, "git://github.com/esl/edown.git", "HEAD"}}]}.
{edoc_opts, [{doclet, edown_doclet}]}.
{deps, [{edown, ".*", {git, "git://github.com/esl/edown.git", "HEAD"}},
{deqc , ".*", {git, "git://github.com/esl/deqc.git" , "HEAD"}}
]}.
{edoc_opts, [{doclet, edown_doclet},
{top_level_readme,
{"./README.md", "http://github.com/esl/unsplit"}}]}.
10 changes: 8 additions & 2 deletions src/unsplit_server.erl
Expand Up @@ -307,8 +307,7 @@ affected_tables(IslandA, IslandB) ->
fun(T, Acc) ->
Nodes = lists:concat(
[mnesia:table_info(T, C) ||
C <- [ram_copies, disc_copies,
disc_only_copies]]),
C <- backend_types()]),
io:fwrite("nodes_of(~p) = ~p~n", [T, Nodes]),
case {intersection(IslandA, Nodes),
intersection(IslandB, Nodes)} of
Expand All @@ -319,6 +318,13 @@ affected_tables(IslandA, IslandB) ->
end
end, [], Tabs).

backend_types() ->
try mnesia:system_info(backend_types)
catch
exit:_ ->
[ram_copies, disc_copies, disc_only_copies]
end.

intersection(A, B) ->
A -- (A -- B).

Expand Down

0 comments on commit 166a81e

Please sign in to comment.