From 0d65deb9d3f66e61f94e65c503b6ac10cb0490e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AD=90=E5=8D=9A?= <349832309@qq.com> Date: Thu, 8 Aug 2019 16:59:17 +0800 Subject: [PATCH] Fix not registering channels in time --- src/emqx_ws_channel.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emqx_ws_channel.erl b/src/emqx_ws_channel.erl index 11349edbc..292294560 100644 --- a/src/emqx_ws_channel.erl +++ b/src/emqx_ws_channel.erl @@ -293,7 +293,6 @@ websocket_info({timeout, Timer, emit_stats}, proto_state = ProtoState, gc_state = GcState}) -> ClientId = emqx_protocol:info(client_id, ProtoState), - ok = emqx_cm:register_channel(ClientId), ok = emqx_cm:set_chan_stats(ClientId, stats(State)), NState = State#state{stats_timer = undefined}, Limits = erlang:get(force_shutdown_policy), @@ -366,6 +365,7 @@ connected(State = #state{proto_state = ProtoState}) -> connected_at = os:timestamp() }, ClientId = emqx_protocol:info(client_id, ProtoState), + ok = emqx_cm:register_channel(ClientId), ok = emqx_cm:set_chan_attrs(ClientId, info(NState)), %% Ensure keepalive after connected successfully. Interval = emqx_protocol:info(keepalive, ProtoState),