fix(emqx_retainer): fix function clause error

This commit is contained in:
lafirest 2021-09-01 12:34:02 +08:00
parent c0eaa30064
commit 9d2f6503af
1 changed files with 3 additions and 1 deletions

View File

@ -74,9 +74,11 @@
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Hook API %% Hook API
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
-spec on_session_subscribed(_, _, emqx_types:subopts(), _) -> any().
on_session_subscribed(_, _, #{share := ShareName}, _) when ShareName =/= undefined -> on_session_subscribed(_, _, #{share := ShareName}, _) when ShareName =/= undefined ->
ok; ok;
on_session_subscribed(_, Topic, #{rh := Rh, is_new := IsNew}, Context) -> on_session_subscribed(_, Topic, #{rh := Rh} = Opts, Context) ->
IsNew = maps:get(is_new, Opts, true),
case Rh =:= 0 orelse (Rh =:= 1 andalso IsNew) of case Rh =:= 0 orelse (Rh =:= 1 andalso IsNew) of
true -> dispatch(Context, Topic); true -> dispatch(Context, Topic);
_ -> ok _ -> ok