From ff99bc10adf89b1520ecc1403a0fc77429f8098a Mon Sep 17 00:00:00 2001 From: Ayodele Date: Fri, 27 Nov 2020 12:45:25 +0100 Subject: [PATCH] Umbrella fix build (#7) * fix(emqx_auth_mongo): Dialyzer warnings * fix(emqx_auth_mnesia_api): Dialyzer warnings * fix(emqx_exhook): Dialyzer warnings --- apps/emqx_auth_mnesia/src/emqx_auth_mnesia_api.erl | 6 ++++-- apps/emqx_auth_mongo/src/emqx_auth_mongo.erl | 2 -- apps/emqx_exhook/src/emqx_exhook.erl | 4 ++-- apps/emqx_exhook/src/emqx_exhook_app.erl | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_api.erl b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_api.erl index ee52fcf36..353ac553c 100644 --- a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia_api.erl +++ b/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), diff --git a/apps/emqx_auth_mongo/src/emqx_auth_mongo.erl b/apps/emqx_auth_mongo/src/emqx_auth_mongo.erl index 4880e6fb9..133bcac70 100644 --- a/apps/emqx_auth_mongo/src/emqx_auth_mongo.erl +++ b/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) -> diff --git a/apps/emqx_exhook/src/emqx_exhook.erl b/apps/emqx_exhook/src/emqx_exhook.erl index c464f31b5..9f6d27b26 100644 --- a/apps/emqx_exhook/src/emqx_exhook.erl +++ b/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 diff --git a/apps/emqx_exhook/src/emqx_exhook_app.erl b/apps/emqx_exhook/src/emqx_exhook_app.erl index e24002abb..b008c251a 100644 --- a/apps/emqx_exhook/src/emqx_exhook_app.erl +++ b/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) ->