fix(gw): fix list listeners failed if gateway disabled
This commit is contained in:
parent
14a26fc876
commit
6c465cfb8f
|
@ -292,7 +292,14 @@ do_listeners_cluster_status(Listeners) ->
|
|||
fun({Id, ListenOn}, Acc) ->
|
||||
BinId = erlang:atom_to_binary(Id),
|
||||
{ok, #{<<"max_connections">> := Max}} = emqx_gateway_conf:listener(BinId),
|
||||
Curr = esockd:get_current_connections({Id, ListenOn}),
|
||||
Curr =
|
||||
try esockd:get_current_connections({Id, ListenOn}) of
|
||||
Int -> Int
|
||||
catch
|
||||
%% not started
|
||||
error:not_found ->
|
||||
0
|
||||
end,
|
||||
Acc#{
|
||||
Id => #{
|
||||
node => Node,
|
||||
|
|
|
@ -173,14 +173,14 @@ handle_info(
|
|||
) ->
|
||||
case lists:member(Pid, Pids) of
|
||||
true ->
|
||||
?SLOG(error, #{
|
||||
?SLOG(info, #{
|
||||
msg => "child_process_exited",
|
||||
child => Pid,
|
||||
reason => Reason
|
||||
}),
|
||||
case Pids -- [Pid] of
|
||||
[] ->
|
||||
?SLOG(error, #{
|
||||
?SLOG(info, #{
|
||||
msg => "gateway_all_children_process_existed",
|
||||
gateway_name => Name
|
||||
}),
|
||||
|
@ -193,7 +193,7 @@ handle_info(
|
|||
{noreply, State#state{child_pids = RemainPids}}
|
||||
end;
|
||||
_ ->
|
||||
?SLOG(error, #{
|
||||
?SLOG(info, #{
|
||||
msg => "gateway_catch_a_unknown_process_exited",
|
||||
child => Pid,
|
||||
reason => Reason,
|
||||
|
|
Loading…
Reference in New Issue