Merge pull request #7956 from EMQ-YangM/fix_status_when_connecting_health_check

fix: when connecting health check failed, update status.
This commit is contained in:
Yang Miao 2022-05-16 11:34:09 +08:00 committed by GitHub
commit 09cf28056f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.