Просмотр исходного кода

Umbrella fix build (#7)

* fix(emqx_auth_mongo): Dialyzer warnings

* fix(emqx_auth_mnesia_api): Dialyzer warnings

* fix(emqx_exhook): Dialyzer warnings
Ayodele 5 лет назад
Родитель
Сommit
ff99bc10ad

+ 4 - 2
apps/emqx_auth_mnesia/src/emqx_auth_mnesia_api.erl

@@ -145,7 +145,7 @@ do_add_clientid(Params) ->
     Password = urldecode(get_value(<<"password">>, Params)),
     Login = {clientid, Clientid},
     case validate([login, password], [Login, Password]) of
-        ok -> 
+        ok ->
             emqx_auth_mnesia_cli:add_user(Login, Password);
         Err -> Err
     end.
@@ -221,7 +221,9 @@ paginate(Tables, MatchSpec, Params, ComparingFun, RowFun) ->
     Limit = limit(Params),
     Cursor = qlc:cursor(Qh),
     case Page > 1 of
-        true  -> qlc:next_answers(Cursor, (Page - 1) * Limit);
+        true  ->
+            _ = qlc:next_answers(Cursor, (Page - 1) * Limit),
+            ok;
         false -> ok
     end,
     Rows = qlc:next_answers(Cursor, Limit),

+ 0 - 2
apps/emqx_auth_mongo/src/emqx_auth_mongo.erl

@@ -82,8 +82,6 @@ description() -> "Authentication with MongoDB".
 %%--------------------------------------------------------------------
 %% Is Superuser?
 %%--------------------------------------------------------------------
-
--spec(is_superuser(string(), maybe(#superquery{}), emqx_types:clientinfo()) -> boolean()).
 is_superuser(_Pool, undefined, _ClientInfo) ->
     false;
 is_superuser(Pool, #superquery{collection = Coll, field = Field, selector = Selector}, ClientInfo) ->

+ 2 - 2
apps/emqx_exhook/src/emqx_exhook.erl

@@ -64,9 +64,9 @@ disable(Name) ->
             unsave(Name)
     end.
 
--spec disable_all() -> [term()].
+-spec disable_all() -> ok.
 disable_all() ->
-    [begin disable(Name), Name end || Name <- running()].
+    lists:foreach(fun disable/1, running()).
 
 %%----------------------------------------------------------
 %% Dispatch APIs

+ 1 - 1
apps/emqx_exhook/src/emqx_exhook_app.erl

@@ -54,7 +54,7 @@ start(_StartType, _StartArgs) ->
 prep_stop(State) ->
     emqx_ctl:unregister_command(exhook),
     _ = unload_exhooks(),
-    _ = unload_all_servers(),
+    ok = unload_all_servers(),
     State.
 
 stop(_State) ->