Merge pull request #2836 from emqx/fix-discard

Fix case clause error
This commit is contained in:
tigercl 2019-08-23 15:18:24 +08:00 committed by GitHub
commit 7151ae9823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -610,9 +610,6 @@ handle_call(Req, Channel) ->
%% Handle cast
%%--------------------------------------------------------------------
handle_cast(discard, Channel) ->
{stop, {shutdown, discarded}, Channel};
handle_cast(Msg, Channel) ->
?LOG(error, "Unexpected cast: ~p", [Msg]),
{ok, Channel}.

View File

@ -233,7 +233,7 @@ discard_session(ClientId) when is_binary(ClientId) ->
discard_session(ClientId, ChanPid) when node(ChanPid) == node() ->
case get_chan_attrs(ClientId, ChanPid) of
#{conn_mod := ConnMod} ->
#{client := #{conn_mod := ConnMod}} ->
ConnMod:discard(ChanPid);
undefined -> ok
end;