chore: fix dialyzer errors
This commit is contained in:
parent
074e25f433
commit
977ac04d24
|
@ -33,6 +33,13 @@ jobs:
|
|||
run: git config --global --add safe.directory /__w/emqx/emqx
|
||||
- name: make xref
|
||||
run: make xref
|
||||
- name: make dialyzer
|
||||
run: |
|
||||
# TODO: once dialyzer warnings are fixed in 4.4+, we may
|
||||
# enforce this.
|
||||
if [[ "$(./pkg-vsn.sh)" =~ 4.3.* ]]; then
|
||||
make dialyzer
|
||||
fi
|
||||
- name: build zip packages
|
||||
run: make ${EMQX_NAME}-zip
|
||||
- name: build deb/rpm packages
|
||||
|
|
|
@ -13,6 +13,12 @@
|
|||
-type(created_at():: integer()).
|
||||
|
||||
-record(emqx_user, {
|
||||
login,
|
||||
password,
|
||||
created_at
|
||||
}).
|
||||
|
||||
-type(emqx_user() :: #emqx_user{
|
||||
login :: login(),
|
||||
password :: binary(),
|
||||
created_at :: created_at()
|
||||
|
|
|
@ -58,7 +58,7 @@ insert_user(User = #emqx_user{login = Login}) ->
|
|||
[_|_] -> mnesia:abort(existed)
|
||||
end.
|
||||
|
||||
-spec(add_default_user(clientid | username, tuple(), binary()) -> ok | {error, any()}).
|
||||
-spec(add_default_user(clientid | username, binary(), binary()) -> ok | {error, any()}).
|
||||
add_default_user(Type, Key, Password) ->
|
||||
Login = {Type, Key},
|
||||
case add_user(Login, Password) of
|
||||
|
|
|
@ -159,7 +159,7 @@ init(ConnInfo = #{socktype := Socktype,
|
|||
Channel = #channel{gcli = #{channel => GRpcChann},
|
||||
conninfo = NConnInfo1,
|
||||
clientinfo = ClientInfo,
|
||||
conn_state = accepted,
|
||||
conn_state = idle,
|
||||
timers = #{}
|
||||
},
|
||||
case emqx_hooks:run_fold('client.connect', [NConnInfo], #{}) of
|
||||
|
|
|
@ -75,7 +75,7 @@ case01(_Config) ->
|
|||
"\nend",
|
||||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
|
||||
Msg = #message{from = <<"myclient">>, qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{username => <<"tester">>}},
|
||||
Msg = #message{id = emqx_guid:gen(), from = <<"myclient">>, qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{username => <<"tester">>}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg#message{payload = <<"hello">>}, Ret).
|
||||
|
||||
|
@ -90,7 +90,7 @@ case02(_Config) ->
|
|||
"\nend",
|
||||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
|
||||
Msg = #message{from = <<"myclient">>, qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{username => <<"tester">>}},
|
||||
Msg = #message{id = emqx_guid:gen(), from = <<"myclient">>, qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{username => <<"tester">>}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg#message{headers = #{username => <<"tester">>, allow_publish => false}}, Ret).
|
||||
|
||||
|
@ -124,7 +124,7 @@ case04(_Config) ->
|
|||
"\nend",
|
||||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
|
||||
Msg = #message{from = <<"broker">>, qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{username => <<"tester">>}},
|
||||
Msg = #message{id = emqx_guid:gen(), from = <<"broker">>, qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{username => <<"tester">>}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg#message{payload = <<"hello broker">>}, Ret).
|
||||
|
||||
|
@ -155,7 +155,7 @@ case12(_Config) ->
|
|||
"\nend",
|
||||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
|
||||
Msg = #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Msg = #message{id = emqx_guid:gen(), qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Ret = emqx_hooks:run_fold('message.delivered', [#{clientid => <<"myclient">>, username => <<"myuser">>}], Msg),
|
||||
?assertEqual(Msg#message{payload = <<"hello broker">>}, Ret).
|
||||
|
||||
|
@ -470,8 +470,9 @@ case101(_Config) ->
|
|||
"\nend",
|
||||
ok = file:write_file(ScriptName2, Code2), ok = emqx_lua_hook:load_scripts(),
|
||||
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}}),
|
||||
?assertEqual(#message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"hello">>, headers = #{}}, Ret),
|
||||
ID = emqx_guid:gen(),
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], #message{id = ID, qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}}),
|
||||
?assertEqual(#message{id = ID, qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"hello">>, headers = #{}}, Ret),
|
||||
|
||||
TopicTable = [{<<"a/b/c">>, [qos, 1]}, {<<"d/+/e">>, [{qos, 2}]}],
|
||||
Ret2 = emqx_hooks:run_fold('client.subscribe',[#{clientid => <<"myclient">>, username => <<"myuser">>}, #{}], TopicTable),
|
||||
|
@ -488,7 +489,7 @@ case110(_Config) ->
|
|||
"\nend",
|
||||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
|
||||
Msg = #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Msg = #message{id = emqx_guid:gen(), qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg#message{topic = <<"changed/topic">>, payload = <<"hello">>}, Ret).
|
||||
|
||||
|
@ -504,7 +505,7 @@ case111(_Config) ->
|
|||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
emqx_ctl:run_command(["luahook", "unload", ScriptName]),
|
||||
|
||||
Msg = #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Msg = #message{id = emqx_guid:gen(), qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg, Ret).
|
||||
|
||||
|
@ -523,7 +524,7 @@ case112(_Config) ->
|
|||
timer:sleep(100),
|
||||
emqx_ctl:run_command(["luahook", "load", "abc.lua"]),
|
||||
|
||||
Msg = #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Msg = #message{id = emqx_guid:gen(), qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg#message{topic = <<"changed/topic">>, payload = <<"hello">>}, Ret).
|
||||
|
||||
|
@ -541,7 +542,7 @@ case113(_Config) ->
|
|||
file:delete(ScriptDisabled),
|
||||
emqx_ctl:run_command(["luahook", "disable", "abc.lua"]), % this command will rename "abc.lua" to "abc.lua.x"
|
||||
|
||||
Msg = #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Msg = #message{id = emqx_guid:gen(), qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg, Ret),
|
||||
true = filelib:is_file(ScriptDisabled).
|
||||
|
@ -558,7 +559,7 @@ case114(_Config) ->
|
|||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
emqx_ctl:run_command(["luahook", "enable", "abc.lua"]),
|
||||
|
||||
Msg = #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Msg = #message{id = emqx_guid:gen(), qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg#message{topic = <<"changed/topic">>, payload = <<"hello">>}, Ret).
|
||||
|
||||
|
@ -578,7 +579,7 @@ case115(_Config) ->
|
|||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
emqx_ctl:run_command(["luahook", "reload", "abc.lua"]),
|
||||
|
||||
Msg = #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Msg = #message{id = emqx_guid:gen(), qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg#message{topic = <<"changed/topic">>, payload = <<"hello">>}, Ret),
|
||||
|
||||
|
@ -636,7 +637,7 @@ case204(_Config) ->
|
|||
"\nend",
|
||||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
|
||||
Msg = #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Msg = #message{id = emqx_guid:gen(), qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg#message{payload = <<"123_Z">>}, Ret).
|
||||
|
||||
|
@ -651,7 +652,7 @@ case205(_Config) ->
|
|||
"\nend",
|
||||
ok = file:write_file(ScriptName, Code), ok = emqx_lua_hook:load_scripts(),
|
||||
|
||||
Msg = #message{qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Msg = #message{id = emqx_guid:gen(), qos = 2, flags = #{retain => true}, topic = <<"a/b/c">>, payload = <<"123">>, headers = #{}},
|
||||
Ret = emqx_hooks:run_fold('message.publish',[], Msg),
|
||||
?assertEqual(Msg, Ret).
|
||||
|
||||
|
|
|
@ -370,7 +370,7 @@ run_fuzzy_match(E = {_, _, Stats}, [{Key, '=<', Int}|Fuzzy]) ->
|
|||
%%--------------------------------------------------------------------
|
||||
%% QueryString to Match Spec
|
||||
|
||||
-spec qs2ms(list()) -> ets:match_spec().
|
||||
-spec qs2ms(list()) -> {ets:match_spec(), [{_Key, _Symbol, _Val}]}.
|
||||
qs2ms(Qs) ->
|
||||
{MatchHead, Conds, FuzzyStats} = qs2ms(Qs, 2, #{}, [], []),
|
||||
{[{{'$1', MatchHead, '_'}, Conds, ['$_']}], FuzzyStats}.
|
||||
|
|
|
@ -61,28 +61,49 @@
|
|||
}).
|
||||
|
||||
-record(action_instance,
|
||||
{ id :: action_instance_id()
|
||||
, name :: action_name()
|
||||
, fallbacks :: list(#action_instance{})
|
||||
, args :: #{binary() => term()} %% the args got from API for initializing action_instance
|
||||
{ id
|
||||
, name
|
||||
, fallbacks
|
||||
, args %% the args got from API for initializing action_instance
|
||||
}).
|
||||
-type(action_instance()
|
||||
:: #action_instance{ id :: action_instance_id()
|
||||
, name :: action_name()
|
||||
, fallbacks :: list(#action_instance{})
|
||||
, args :: #{binary() => term()} %% the args got from API for initializing action_instance
|
||||
}).
|
||||
|
||||
-record(rule,
|
||||
{ id :: rule_id()
|
||||
, for :: list(topic())
|
||||
, rawsql :: binary()
|
||||
, is_foreach :: boolean()
|
||||
, fields :: list()
|
||||
, doeach :: term()
|
||||
, incase :: list()
|
||||
, conditions :: tuple()
|
||||
, on_action_failed :: continue | stop
|
||||
, actions :: list(#action_instance{})
|
||||
, enabled :: boolean()
|
||||
, created_at :: integer() %% epoch in millisecond precision
|
||||
, description :: binary()
|
||||
, state = normal :: atom()
|
||||
{ id
|
||||
, for
|
||||
, rawsql
|
||||
, is_foreach
|
||||
, fields
|
||||
, doeach
|
||||
, incase
|
||||
, conditions
|
||||
, on_action_failed
|
||||
, actions
|
||||
, enabled
|
||||
, created_at %% epoch in millisecond precision
|
||||
, description
|
||||
, state = normal
|
||||
}).
|
||||
-type(rule() :: #rule{ id :: rule_id()
|
||||
, for :: list(topic())
|
||||
, rawsql :: binary()
|
||||
, is_foreach :: boolean()
|
||||
, fields :: list()
|
||||
, doeach :: term()
|
||||
, incase :: list()
|
||||
, conditions :: tuple()
|
||||
, on_action_failed :: continue | stop
|
||||
, actions :: list(#action_instance{})
|
||||
, enabled :: boolean()
|
||||
, created_at :: integer() %% epoch in millisecond precision
|
||||
, description :: binary()
|
||||
, state :: normal | atom()
|
||||
}).
|
||||
|
||||
-record(resource,
|
||||
{ id :: resource_id()
|
||||
|
|
|
@ -2,17 +2,20 @@
|
|||
%% Unless you know what you are doing, DO NOT edit manually!!
|
||||
{VSN,
|
||||
[{"4.3.13",
|
||||
[{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_rule_engine,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_utils,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_runtime,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_registry,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.12",
|
||||
[{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_rule_engine,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_utils,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_runtime,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_registry,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.11",
|
||||
[{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_rule_engine,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_utils,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_runtime,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_registry,brutal_purge,soft_purge,[]},
|
||||
|
@ -178,17 +181,20 @@
|
|||
{load_module,emqx_rule_engine_api,brutal_purge,soft_purge,[]}]},
|
||||
{<<".*">>,[]}],
|
||||
[{"4.3.13",
|
||||
[{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_rule_engine,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_utils,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_runtime,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_registry,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.12",
|
||||
[{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_rule_engine,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_utils,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_runtime,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_registry,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.11",
|
||||
[{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_rule_engine,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_actions,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_utils,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_registry,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_rule_validator,brutal_purge,soft_purge,[]},
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
-export([alarm_name_of_resource_down/2]).
|
||||
-endif.
|
||||
|
||||
-type(rule() :: #rule{}).
|
||||
-type(action() :: #action{}).
|
||||
-type(resource() :: #resource{}).
|
||||
-type(resource_type() :: #resource_type{}).
|
||||
|
@ -172,7 +171,6 @@ module_attributes(Module) ->
|
|||
%% APIs for rules and resources
|
||||
%%------------------------------------------------------------------------------
|
||||
|
||||
-dialyzer([{nowarn_function, [create_rule/1, rule_id/0]}]).
|
||||
-spec create_rule(map()) -> {ok, rule()} | {error, term()}.
|
||||
create_rule(Params = #{rawsql := Sql, actions := ActArgs}) ->
|
||||
case emqx_rule_sqlparser:parse_select(Sql) of
|
||||
|
@ -307,7 +305,7 @@ do_check_and_update_resource(#{id := Id, type := Type, description := NewDescrip
|
|||
Config = emqx_rule_validator:validate_params(NewConfig, ParamSpec),
|
||||
case test_resource(#{type => Type, config => NewConfig}) of
|
||||
ok ->
|
||||
delete_resource(Id),
|
||||
_ = delete_resource(Id),
|
||||
_ = ?CLUSTER_CALL(init_resource, [Module, Create, Id, Config]),
|
||||
emqx_rule_registry:add_resource(#resource{
|
||||
id = Id,
|
||||
|
|
|
@ -52,7 +52,7 @@ apply_rules([], _Input) ->
|
|||
apply_rules([#rule{enabled = false}|More], Input) ->
|
||||
apply_rules(More, Input);
|
||||
apply_rules([Rule|More], Input) ->
|
||||
apply_rule(Rule, Input),
|
||||
_ = apply_rule(Rule, Input),
|
||||
apply_rules(More, Input).
|
||||
|
||||
apply_rule(Rule = #rule{id = RuleId}, Input) ->
|
||||
|
|
|
@ -48,10 +48,6 @@
|
|||
|
||||
-export_type([select/0]).
|
||||
|
||||
%% Dialyzer gives up on the generated code.
|
||||
%% probably due to stack depth, or inlines.
|
||||
-dialyzer({nowarn_function, [parse_select/1]}).
|
||||
|
||||
%% Parse one select statement.
|
||||
-spec(parse_select(string() | binary())
|
||||
-> {ok, select()} | {parse_error, term()} | {lex_error, term()}).
|
||||
|
@ -105,4 +101,3 @@ select_from(#select{from = From}) ->
|
|||
-spec(select_where(select()) -> tuple()).
|
||||
select_where(#select{where = Where}) ->
|
||||
Where.
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
, {replayq, {git, "https://github.com/emqx/replayq", {tag, "0.3.4"}}}
|
||||
, {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {branch, "2.0.4"}}}
|
||||
, {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3.1"}}}
|
||||
, {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.2"}}}
|
||||
, {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.4"}}}
|
||||
, {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}}
|
||||
, {observer_cli, "1.6.1"} % NOTE: depends on recon 2.5.1
|
||||
, {getopt, "1.0.1"}
|
||||
|
|
|
@ -2,19 +2,22 @@
|
|||
%% Unless you know what you are doing, DO NOT edit manually!!
|
||||
{VSN,
|
||||
[{"4.3.19",
|
||||
[{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_app,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_plugins,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_channel,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.18",
|
||||
[{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_channel,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_app,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_plugins,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.17",
|
||||
[{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_channel,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx,brutal_purge,soft_purge,[]},
|
||||
|
@ -26,7 +29,8 @@
|
|||
{load_module,emqx_plugins,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_access_control,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.16",
|
||||
[{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_session,brutal_purge,soft_purge,[]},
|
||||
|
@ -45,7 +49,8 @@
|
|||
{load_module,emqx_mqtt_caps,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_topic,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.15",
|
||||
[{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx,brutal_purge,soft_purge,[]},
|
||||
{add_module,emqx_calendar},
|
||||
{load_module,emqx_topic,brutal_purge,soft_purge,[]},
|
||||
|
@ -72,7 +77,8 @@
|
|||
{update,emqx_os_mon,{advanced,[]}},
|
||||
{load_module,emqx_app,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.14",
|
||||
[{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{add_module,emqx_calendar},
|
||||
{load_module,emqx_topic,brutal_purge,soft_purge,[]},
|
||||
{add_module,emqx_exclusive_subscription},
|
||||
|
@ -101,7 +107,8 @@
|
|||
{update,emqx_os_mon,{advanced,[]}},
|
||||
{load_module,emqx_hooks,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.13",
|
||||
[{add_module,emqx_calendar},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{add_module,emqx_calendar},
|
||||
{load_module,emqx_topic,brutal_purge,soft_purge,[]},
|
||||
{add_module,emqx_exclusive_subscription},
|
||||
{apply,{emqx_exclusive_subscription,on_add_module,[]}},
|
||||
|
@ -701,19 +708,22 @@
|
|||
{load_module,emqx_limiter,brutal_purge,soft_purge,[]}]},
|
||||
{<<".*">>,[]}],
|
||||
[{"4.3.19",
|
||||
[{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_app,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_plugins,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_channel,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.18",
|
||||
[{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_channel,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_app,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_plugins,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.17",
|
||||
[{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_channel,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx,brutal_purge,soft_purge,[]},
|
||||
|
@ -725,7 +735,8 @@
|
|||
{load_module,emqx_plugins,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_access_control,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.16",
|
||||
[{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_misc,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_session,brutal_purge,soft_purge,[]},
|
||||
|
@ -744,7 +755,8 @@
|
|||
{apply,{emqx_exclusive_subscription,on_delete_module,[]}},
|
||||
{delete_module,emqx_exclusive_subscription}]},
|
||||
{"4.3.15",
|
||||
[{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx,brutal_purge,soft_purge,[]},
|
||||
{delete_module,emqx_calendar},
|
||||
{apply,{emqx_exclusive_subscription,on_delete_module,[]}},
|
||||
|
@ -770,7 +782,8 @@
|
|||
{load_module,emqx_os_mon,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_app,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.14",
|
||||
[{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_cm,brutal_purge,soft_purge,[]},
|
||||
{delete_module,emqx_calendar},
|
||||
{apply,{emqx_exclusive_subscription,on_delete_module,[]}},
|
||||
{delete_module,emqx_exclusive_subscription},
|
||||
|
@ -798,7 +811,8 @@
|
|||
{load_module,emqx_os_mon,brutal_purge,soft_purge,[]},
|
||||
{load_module,emqx_hooks,brutal_purge,soft_purge,[]}]},
|
||||
{"4.3.13",
|
||||
[{delete_module,emqx_calendar},
|
||||
[{load_module,emqx_message,brutal_purge,soft_purge,[]},
|
||||
{delete_module,emqx_calendar},
|
||||
{apply,{emqx_exclusive_subscription,on_delete_module,[]}},
|
||||
{delete_module,emqx_exclusive_subscription},
|
||||
{load_module,emqx_topic,brutal_purge,soft_purge,[]},
|
||||
|
|
|
@ -236,7 +236,7 @@ shutdown(Reason) ->
|
|||
reboot() ->
|
||||
case is_application_running(emqx_dashboard) of
|
||||
true ->
|
||||
application:stop(emqx_dashboard), %% dashboard must be started after mnesia
|
||||
_ = application:stop(emqx_dashboard), %% dashboard must be started after mnesia
|
||||
lists:foreach(fun application:start/1 , default_started_applications()),
|
||||
application:start(emqx_dashboard);
|
||||
|
||||
|
|
|
@ -317,7 +317,6 @@ trans_x_second(FromUnit, ToUnit, Time) ->
|
|||
end,
|
||||
padding(XSecond, Len).
|
||||
|
||||
do_trans_x_second(second, second, Time) -> Time div 60;
|
||||
do_trans_x_second(second, _, _Time) -> 0;
|
||||
|
||||
do_trans_x_second(millisecond, millisecond, Time) -> Time rem 1000;
|
||||
|
@ -433,4 +432,3 @@ dm(9) -> 243;
|
|||
dm(10) -> 273;
|
||||
dm(11) -> 304;
|
||||
dm(12) -> 334.
|
||||
|
||||
|
|
|
@ -1702,8 +1702,7 @@ disconnect_reason(?RC_SUCCESS) -> normal;
|
|||
disconnect_reason(ReasonCode) -> emqx_reason_codes:name(ReasonCode).
|
||||
|
||||
reason_code(takeovered) -> ?RC_SESSION_TAKEN_OVER;
|
||||
reason_code(discarded) -> ?RC_SESSION_TAKEN_OVER;
|
||||
reason_code(_) -> ?RC_NORMAL_DISCONNECTION.
|
||||
reason_code(discarded) -> ?RC_SESSION_TAKEN_OVER.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Helper functions
|
||||
|
|
|
@ -343,8 +343,6 @@ format(#message{id = Id,
|
|||
[printable_msg_id(Id), QoS, Topic, From, format(flags, Flags),
|
||||
format(headers, Headers)]).
|
||||
|
||||
printable_msg_id(undefined) ->
|
||||
<<>>;
|
||||
printable_msg_id(Id) ->
|
||||
emqx_guid:to_hexstr(Id).
|
||||
|
||||
|
@ -352,4 +350,3 @@ format(flags, Flags) ->
|
|||
io_lib:format("~p", [[Flag || {Flag, true} <- maps:to_list(Flags)]]);
|
||||
format(headers, Headers) ->
|
||||
io_lib:format("~p", [Headers]).
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ maybe_nack_dropped(Msg) ->
|
|||
|
||||
%% For retry Ref we can't reject a message if inflight is full, so we mark it as
|
||||
%% acknowledged and put it into mqueue
|
||||
{_Sender, {retry, _Group, _Ref}} -> maybe_ack(Msg), store;
|
||||
{_Sender, {retry, _Group, _Ref}} -> _ = maybe_ack(Msg), store;
|
||||
|
||||
%% This clause is for backward compatibility
|
||||
Ack ->
|
||||
|
|
Loading…
Reference in New Issue