Przeglądaj źródła

fix: when connecting health check failed, update status.

EMQ-YangM 3 lat temu
rodzic
commit
1a1c82932a
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      apps/emqx_resource/src/emqx_resource_manager.erl

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

@@ -374,7 +374,7 @@ connecting_health_check(Data) ->
             {next_state, connected, UpdatedData};
         ConnectStatus ->
             logger:error("health check for ~p failed: ~p", [Data#data.id, ConnectStatus]),
-            UpdatedData = Data#data{error = ConnectStatus},
+            UpdatedData = Data#data{status = connecting, error = ConnectStatus},
             Actions = [{state_timeout, ?SHORT_HEALTHCHECK_INTERVAL, health_check}],
             {keep_state, UpdatedData, Actions}
     end.