fix(exproto): ignore undefined clientid

This commit is contained in:
JianBo He 2021-03-06 15:28:18 +08:00
parent f9d5d3523d
commit ebffdafe86
1 changed files with 6 additions and 2 deletions

View File

@ -515,8 +515,12 @@ handle_timeout(TRef, keepalive, State = #state{socket = Socket,
end; end;
handle_timeout(_TRef, emit_stats, State = handle_timeout(_TRef, emit_stats, State =
#state{channel = Channel}) -> #state{channel = Channel}) ->
ClientId = emqx_exproto_channel:info(clientid, Channel), case emqx_exproto_channel:info(clientid, Channel) of
emqx_cm:set_chan_stats(ClientId, stats(State)), undefined ->
ignore;
ClientId ->
emqx_cm:set_chan_stats(ClientId, stats(State))
end,
{ok, State#state{stats_timer = undefined}}; {ok, State#state{stats_timer = undefined}};
handle_timeout(TRef, Msg, State) -> handle_timeout(TRef, Msg, State) ->