Explorar o código

Merge pull request #7956 from EMQ-YangM/fix_status_when_connecting_health_check

fix: when connecting health check failed, update status.
Yang Miao %!s(int64=3) %!d(string=hai) anos
pai
achega
09cf28056f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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.