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

fix(emqx_resource_instance): fix dialyzer warning

EMQ-YangM 3 лет назад
Родитель
Сommit
db0e9e3358

+ 1 - 1
apps/emqx_resource/src/emqx_resource_instance.erl

@@ -182,7 +182,7 @@ wait_for_resource_ready(InstId, 0) ->
     force_lookup(InstId);
 wait_for_resource_ready(InstId, Retry) ->
     case force_lookup(InstId) of
-        #{resource_data := #{status := connected}} = Data -> Data;
+        #{status := connected} = Data -> Data;
         _ ->
             timer:sleep(100),
             wait_for_resource_ready(InstId, Retry-1)

+ 2 - 0
apps/emqx_resource/test/emqx_resource_SUITE.erl

@@ -221,6 +221,8 @@ t_stop_start(_) ->
 
     ok = emqx_resource:restart(?ID),
 
+    timer:sleep(300),
+
     #{pid := Pid1} = emqx_resource:query(?ID, get_state),
 
     ?assert(is_process_alive(Pid1)).