Explorar o código

refactor(banned): Export transactions

ieQu1 %!s(int64=3) %!d(string=hai) anos
pai
achega
8ef1c2db26
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      apps/emqx/src/emqx_banned.erl

+ 8 - 1
apps/emqx/src/emqx_banned.erl

@@ -49,6 +49,11 @@
     code_change/3
     code_change/3
 ]).
 ]).
 
 
+%% Internal exports (RPC)
+-export([
+    expire_banned_items/1
+]).
+
 -elvis([{elvis_style, state_record_and_type, disable}]).
 -elvis([{elvis_style, state_record_and_type, disable}]).
 
 
 -define(BANNED_TAB, ?MODULE).
 -define(BANNED_TAB, ?MODULE).
@@ -224,7 +229,9 @@ handle_cast(Msg, State) ->
     {noreply, State}.
     {noreply, State}.
 
 
 handle_info({timeout, TRef, expire}, State = #{expiry_timer := TRef}) ->
 handle_info({timeout, TRef, expire}, State = #{expiry_timer := TRef}) ->
-    _ = mria:transaction(?COMMON_SHARD, fun expire_banned_items/1, [erlang:system_time(second)]),
+    _ = mria:transaction(?COMMON_SHARD, fun ?MODULE:expire_banned_items/1, [
+        erlang:system_time(second)
+    ]),
     {noreply, ensure_expiry_timer(State), hibernate};
     {noreply, ensure_expiry_timer(State), hibernate};
 handle_info(Info, State) ->
 handle_info(Info, State) ->
     ?SLOG(error, #{msg => "unexpected_info", info => Info}),
     ?SLOG(error, #{msg => "unexpected_info", info => Info}),