Merge pull request #9415 from zhongwencool/set-channel-info

chore: set channel info once
This commit is contained in:
zhongwencool 2022-11-24 15:08:50 +08:00 committed by GitHub
commit e12f649468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -601,8 +601,7 @@ handle_msg({event, disconnected}, State = #state{channel = Channel}) ->
{ok, State};
handle_msg({event, _Other}, State = #state{channel = Channel}) ->
ClientId = emqx_channel:info(clientid, Channel),
emqx_cm:set_chan_info(ClientId, info(State)),
emqx_cm:set_chan_stats(ClientId, stats(State)),
emqx_cm:insert_channel_info(ClientId, info(State), stats(State)),
{ok, State};
handle_msg({timeout, TRef, TMsg}, State) ->
handle_timeout(TRef, TMsg, State);

View File

@ -16,7 +16,7 @@
-module(emqx_gateway_impl).
-include("include/emqx_gateway.hrl").
-include("emqx_gateway.hrl").
-type state() :: map().
-type reason() :: any().