Merge pull request #10466 from lafirest/fix/rocketmq_status

fix(rocketmq): fix that the status check of RocketMQ bridge may not accurate
This commit is contained in:
JianBo He 2023-04-21 14:30:24 +08:00 committed by GitHub
commit c28f5fc425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
%%========================================================================================