fix: bpapi undef abort on old node
This commit is contained in:
parent
c8487d8890
commit
56a40d61ae
|
@ -88,11 +88,10 @@ announce(Node, App) ->
|
||||||
{ok, Data} = file:consult(?MODULE:versions_file(App)),
|
{ok, Data} = file:consult(?MODULE:versions_file(App)),
|
||||||
%% replicant(5.6.0) will call old core(<5.6.0) announce_fun/2 is undef on old core
|
%% replicant(5.6.0) will call old core(<5.6.0) announce_fun/2 is undef on old core
|
||||||
%% so we just use anonymous function to update.
|
%% so we just use anonymous function to update.
|
||||||
try
|
case mria:transaction(?COMMON_SHARD, fun ?MODULE:announce_fun/2, [Node, Data]) of
|
||||||
{atomic, ok} = mria:transaction(?COMMON_SHARD, fun ?MODULE:announce_fun/2, [Node, Data]),
|
{atomic, ok} ->
|
||||||
ok
|
ok;
|
||||||
catch
|
{aborted, {undef, [{?MODULE, announce_fun, _, _} | _]}} ->
|
||||||
error:undef ->
|
|
||||||
{atomic, ok} = mria:transaction(
|
{atomic, ok} = mria:transaction(
|
||||||
?COMMON_SHARD,
|
?COMMON_SHARD,
|
||||||
fun() ->
|
fun() ->
|
||||||
|
|
Loading…
Reference in New Issue