fix(emqx_bridge): fix bridge status

This commit is contained in:
EMQ-YangM 2022-02-25 15:25:46 +08:00
parent 376c9ee261
commit fa21fa2432
2 changed files with 2 additions and 2 deletions

View File

@ -423,7 +423,7 @@ aggregate_metrics(AllMetrics) ->
format_resp(#{id := Id, raw_config := RawConf, format_resp(#{id := Id, raw_config := RawConf,
resource_data := #{status := Status, metrics := Metrics}}) -> resource_data := #{status := Status, metrics := Metrics}}) ->
{Type, BridgeName} = emqx_bridge:parse_bridge_id(Id), {Type, BridgeName} = emqx_bridge:parse_bridge_id(Id),
IsConnected = fun(started) -> connected; (_) -> disconnected end, IsConnected = fun(connected) -> connected; (_) -> disconnected end,
RawConf#{ RawConf#{
id => Id, id => Id,
type => Type, type => Type,

View File

@ -331,7 +331,7 @@ wait_for_resource_ready(InstId, 0) ->
ct:fail(wait_resource_timeout); ct:fail(wait_resource_timeout);
wait_for_resource_ready(InstId, Retry) -> wait_for_resource_ready(InstId, Retry) ->
case emqx_bridge:lookup(InstId) of case emqx_bridge:lookup(InstId) of
{ok, #{resource_data := #{status := started}}} -> ok; {ok, #{resource_data := #{status := connected}}} -> ok;
_ -> _ ->
timer:sleep(100), timer:sleep(100),
wait_for_resource_ready(InstId, Retry-1) wait_for_resource_ready(InstId, Retry-1)