Register channel in this module
This commit is contained in:
parent
51fb4e33d6
commit
c880668419
|
@ -255,6 +255,7 @@ connected(enter, _PrevSt, State = #state{proto_state = ProtoState}) ->
|
||||||
NState = State#state{connected = true,
|
NState = State#state{connected = true,
|
||||||
connected_at = os:timestamp()},
|
connected_at = os:timestamp()},
|
||||||
ClientId = emqx_protocol:info(client_id, ProtoState),
|
ClientId = emqx_protocol:info(client_id, ProtoState),
|
||||||
|
ok = emqx_cm:register_channel(ClientId),
|
||||||
ok = emqx_cm:set_chan_attrs(ClientId, attrs(NState)),
|
ok = emqx_cm:set_chan_attrs(ClientId, attrs(NState)),
|
||||||
%% Ensure keepalive after connected successfully.
|
%% Ensure keepalive after connected successfully.
|
||||||
Interval = emqx_protocol:info(keepalive, ProtoState),
|
Interval = emqx_protocol:info(keepalive, ProtoState),
|
||||||
|
|
|
@ -293,6 +293,7 @@ websocket_info({timeout, Timer, emit_stats},
|
||||||
proto_state = ProtoState,
|
proto_state = ProtoState,
|
||||||
gc_state = GcState}) ->
|
gc_state = GcState}) ->
|
||||||
ClientId = emqx_protocol:info(client_id, ProtoState),
|
ClientId = emqx_protocol:info(client_id, ProtoState),
|
||||||
|
ok = emqx_cm:register_channel(ClientId),
|
||||||
ok = emqx_cm:set_chan_stats(ClientId, stats(State)),
|
ok = emqx_cm:set_chan_stats(ClientId, stats(State)),
|
||||||
NState = State#state{stats_timer = undefined},
|
NState = State#state{stats_timer = undefined},
|
||||||
Limits = erlang:get(force_shutdown_policy),
|
Limits = erlang:get(force_shutdown_policy),
|
||||||
|
|
Loading…
Reference in New Issue