fix(gw): fix conn_state

This commit is contained in:
JianBo He 2021-08-17 14:17:56 +08:00
parent c5a4e05418
commit 430f20adc1
1 changed files with 7 additions and 2 deletions

View File

@ -107,7 +107,12 @@ gateway(_) ->
'gateway-clients'(["list", Name]) ->
InfoTab = emqx_gateway_cm:tabname(info, Name),
dump(InfoTab, client);
case ets:info(InfoTab) of
undefined ->
emqx_ctl:print("Bad Gateway Name.~n");
_ ->
dump(InfoTab, client)
end;
'gateway-clients'(["lookup", Name, ClientId]) ->
ChanTab = emqx_gateway_cm:tabname(chan, Name),
@ -191,7 +196,7 @@ print({client, {_, Infos, Stats}}) ->
keepalive => SafeGet(keepalive, ConnInfo),
subscriptions_cnt => StatsGet(subscriptions_cnt),
send_msg => StatsGet(send_msg),
connected => SafeGet(conn_state, ClientInfo) == connected,
connected => SafeGet(conn_state, Infos) == connected,
created_at => ConnectedAt,
connected_at => ConnectedAt
},