fix(rocketmq): fix that the status check of RocketMQ bridge may not accurate

This commit is contained in:
firest 2023-04-21 13:35:29 +08:00
parent c2385f85d6
commit f602900a53
1 changed files with 5 additions and 2 deletions

View File

@ -154,12 +154,15 @@ on_batch_query(_InstanceId, Query, _State) ->
on_get_status(_InstanceId, #{client_id := ClientId}) ->
case rocketmq_client_sup:find_client(ClientId) of
{ok, _Pid} ->
connected;
{ok, Pid} ->
status_result(rocketmq_client:get_status(Pid));
_ ->
connecting
end.
status_result(_Status = true) -> connected;
status_result(_Status) -> connecting.
%%========================================================================================
%% Helper fns
%%========================================================================================