Fix some dialyzer warnings (#3988)
This commit is contained in:
parent
ca1e78677e
commit
2b481dabe7
|
@ -105,6 +105,8 @@ validate_params(Params) ->
|
|||
{error, ?ERROR8, Msg}
|
||||
end.
|
||||
|
||||
%% TODO who and reason is undefined - causing dialyzer errors. fix later
|
||||
-dialyzer({nowarn_function,pack_banned/1}).
|
||||
pack_banned(Params) ->
|
||||
Now = erlang:system_time(second),
|
||||
do_pack_banned(Params, #banned{by = <<"user">>,
|
||||
|
|
|
@ -145,6 +145,7 @@
|
|||
|
||||
-record(banned, {
|
||||
who :: {clientid, binary()}
|
||||
| {peerhost, inet:ip_address()}
|
||||
| {username, binary()}
|
||||
| {ip_address, inet:ip_address()},
|
||||
by :: binary(),
|
||||
|
|
|
@ -184,7 +184,7 @@ hook(HookPoint, Action, InitArgs) when is_list(InitArgs) ->
|
|||
hook(HookPoint, Action, Filter, Priority) ->
|
||||
emqx_hooks:add(HookPoint, Action, Filter, Priority).
|
||||
|
||||
-spec(unhook(emqx_hooks:hookpoint(), fun() | {atom(), atom()} | {atom(), atom(), [any()]}) -> ok).
|
||||
-spec(unhook(emqx_hooks:hookpoint(), emqx_hooks:action() | {module(), atom()}) -> ok).
|
||||
unhook(HookPoint, Action) ->
|
||||
emqx_hooks:del(HookPoint, Action).
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ put(HookPoint, Callback) ->
|
|||
end.
|
||||
|
||||
%% @doc Unregister a callback.
|
||||
-spec(del(hookpoint(), function() | {module(), atom()}) -> ok).
|
||||
-spec(del(hookpoint(), action() | {module(), atom()}) -> ok).
|
||||
del(HookPoint, Action) ->
|
||||
gen_server:cast(?SERVER, {del, HookPoint, Action}).
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
expiry_interval => non_neg_integer(),
|
||||
atom() => term()
|
||||
}).
|
||||
-type(clientinfo() :: #{zone := zone(),
|
||||
-type(clientinfo() :: #{zone := maybe(zone()),
|
||||
protocol := protocol(),
|
||||
peerhost := peerhost(),
|
||||
sockport := non_neg_integer(),
|
||||
|
|
Loading…
Reference in New Issue