fix: when connecting health check failed, update status.

This commit is contained in:
EMQ-YangM 2022-05-16 10:26:27 +08:00
parent bd51edf989
commit 1a1c82932a
1 changed files with 1 additions and 1 deletions

View File

@ -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.