refactor(router_helper): Export transactions

This commit is contained in:
ieQu1 2022-08-18 12:12:19 +02:00
parent 8ef1c2db26
commit cd3aa476c6
1 changed files with 6 additions and 1 deletions

View File

@ -47,6 +47,11 @@
code_change/3
]).
%% Internal exports (RPC)
-export([
cleanup_routes/1
]).
-record(routing_node, {name, const = unused}).
-define(ROUTE, emqx_route).
@ -145,7 +150,7 @@ handle_info({nodedown, Node}, State = #{nodes := Nodes}) ->
global:trans(
{?LOCK, self()},
fun() ->
mria:transaction(?ROUTE_SHARD, fun cleanup_routes/1, [Node])
mria:transaction(?ROUTE_SHARD, fun ?MODULE:cleanup_routes/1, [Node])
end
),
ok = mria:dirty_delete(?ROUTING_NODE, Node),