Merge pull request #7957 from EMQ-YangM/fix_other_events
fix: ignore all other events
This commit is contained in:
commit
5d5a6a14cf
|
@ -53,7 +53,7 @@ init_per_suite(Config) ->
|
||||||
emqx_bridge
|
emqx_bridge
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
ok = emqx_common_test_helpers:load_config(emqx_connector_schema, <<"connectors: {}">>),
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
end_per_suite(_Config) ->
|
end_per_suite(_Config) ->
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
-include("emqx_resource.hrl").
|
-include("emqx_resource.hrl").
|
||||||
-include("emqx_resource_utils.hrl").
|
-include("emqx_resource_utils.hrl").
|
||||||
|
-include_lib("emqx/include/logger.hrl").
|
||||||
|
|
||||||
% API
|
% API
|
||||||
-export([
|
-export([
|
||||||
|
@ -273,7 +274,20 @@ handle_event({call, From}, health_check, stopped, _Data) ->
|
||||||
Actions = [{reply, From, {error, stopped}}],
|
Actions = [{reply, From, {error, stopped}}],
|
||||||
{keep_state_and_data, Actions};
|
{keep_state_and_data, Actions};
|
||||||
handle_event({call, From}, health_check, _State, Data) ->
|
handle_event({call, From}, health_check, _State, Data) ->
|
||||||
handle_health_check_event(From, Data).
|
handle_health_check_event(From, Data);
|
||||||
|
% Ignore all other events
|
||||||
|
handle_event(EventType, EventData, State, Data) ->
|
||||||
|
?SLOG(
|
||||||
|
error,
|
||||||
|
#{
|
||||||
|
msg => "ignore all other events",
|
||||||
|
event_type => EventType,
|
||||||
|
event_data => EventData,
|
||||||
|
state => State,
|
||||||
|
data => Data
|
||||||
|
}
|
||||||
|
),
|
||||||
|
{next_state, State, Data}.
|
||||||
|
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
%% internal functions
|
%% internal functions
|
||||||
|
|
|
@ -318,7 +318,7 @@ t_create_dry_run_local(_) ->
|
||||||
#{name => test_resource, register => true}
|
#{name => test_resource, register => true}
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
timer:sleep(100),
|
||||||
?assertEqual(undefined, whereis(test_resource)).
|
?assertEqual(undefined, whereis(test_resource)).
|
||||||
|
|
||||||
t_create_dry_run_local_failed(_) ->
|
t_create_dry_run_local_failed(_) ->
|
||||||
|
|
Loading…
Reference in New Issue