fix(http action): use correct return value for channel health check

Fixes https://emqx.atlassian.net/browse/EMQX-12622
This commit is contained in:
Thales Macedo Garitezi 2024-07-01 11:17:01 -03:00
parent d1e9b097d1
commit 72664780df
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{application, emqx_bridge_http, [
{description, "EMQX HTTP Bridge and Connector Application"},
{vsn, "0.3.2"},
{vsn, "0.3.3"},
{registered, []},
{applications, [kernel, stdlib, emqx_resource, ehttpc]},
{env, [

View File

@ -640,8 +640,14 @@ on_get_channel_status(
_ChannelId,
State
) ->
%% XXX: Reuse the connector status
on_get_status(InstId, State).
%% N.B.: `on_get_channel_status' expects a different return value than
%% `on_get_status'.
case on_get_status(InstId, State, fun default_health_checker/2) of
{Status, _State, Reason} ->
{Status, Reason};
Res ->
Res
end.
on_format_query_result({ok, Status, Headers, Body}) ->
#{