parent
97474171d0
commit
938d30268a
|
@ -156,15 +156,13 @@ handle_call({register_mod, Type, Mod, Opts, Seq}, _From, State) ->
|
|||
reply(case lists:keymember(Mod, 1, Mods) of
|
||||
true -> {error, already_exists};
|
||||
false ->
|
||||
try
|
||||
case Mod:init(Opts) of
|
||||
try Mod:init(Opts) of
|
||||
{ok, ModState} ->
|
||||
NewMods = lists:sort(fun({_, _, Seq1}, {_, _, Seq2}) ->
|
||||
Seq1 >= Seq2
|
||||
end, [{Mod, ModState, Seq} | Mods]),
|
||||
ets:insert(?TAB, {tab_key(Type), NewMods}),
|
||||
ok
|
||||
end
|
||||
catch
|
||||
_:Error ->
|
||||
emqx_logger:error("[AccessControl] Failed to init ~s: ~p", [Mod, Error]),
|
||||
|
|
Loading…
Reference in New Issue