Be more lenient about mnesia asking more than once

This commit is contained in:
Ulf Wiger 2022-07-15 14:14:06 +02:00
parent 302aa1252b
commit c4235be94a

View File

@ -510,12 +510,17 @@ intersection(A, B) ->
-spec handle_req(alias(), req(), backend(), st()) -> gen_server_reply(). -spec handle_req(alias(), req(), backend(), st()) -> gen_server_reply().
handle_req(Alias, {create_table, Name, Props}, Backend, St) -> handle_req(Alias, {create_table, Name, Props}, Backend, St) ->
case find_cf(Alias, Name, Backend, St) of
{ok, TRec} ->
{reply, {ok, TRec}, St};
error ->
case create_trec(Alias, Name, Props, Backend, St) of case create_trec(Alias, Name, Props, Backend, St) of
{ok, NewCf} -> {ok, NewCf} ->
St1 = update_cf(Alias, Name, NewCf, St), St1 = update_cf(Alias, Name, NewCf, St),
{reply, {ok, NewCf}, St1}; {reply, {ok, NewCf}, St1};
{error, _} = Error -> {error, _} = Error ->
{reply, Error, St} {reply, Error, St}
end
end; end;
handle_req(Alias, {load_table, Name, Props}, Backend, St) -> handle_req(Alias, {load_table, Name, Props}, Backend, St) ->
try try