Skip to content

Commit

Permalink
chore: update some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan committed Feb 26, 2024
1 parent 718d24a commit 26fc157
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/emqx/src/emqx_channel.erl
Expand Up @@ -2237,7 +2237,7 @@ session_disconnect(_ClientInfo, _ConnInfo, undefined) ->

%%--------------------------------------------------------------------
%% Maybe Publish will msg
%% @doc May publish will message [MQTT-3.1.2-8]
%% @doc Maybe publish will message [MQTT-3.1.2-8]
%% When willmsg presents the decision whether or when to publish the Will Message are effected by
%% the followings:
%% - connecion state
Expand Down Expand Up @@ -2351,7 +2351,6 @@ maybe_publish_will_msg(
?tp(debug, maybe_publish_willmsg_takenover_skip, #{clientid => ClientId}),
skip
end,
%% Maybe we should cancel first then send
remove_willmsg(Channel);
maybe_publish_will_msg(
Reason,
Expand All @@ -2368,7 +2367,6 @@ maybe_publish_will_msg(
clientid => ClientId, reason => Reason
}),
_ = publish_will_msg(ClientInfo, WillMsg),
%% Maybe we should cancel first then send
remove_willmsg(Channel);
I when I > 0 ->
?tp(debug, maybe_publish_will_msg_other_delay, #{clientid => ClientId, reason => Reason}),
Expand Down Expand Up @@ -2504,6 +2502,7 @@ get_mqtt_conf(Zone, Key) ->
get_mqtt_conf(Zone, Key, Default) ->
emqx_config:get_zone_conf(Zone, [mqtt, Key], Default).

%% @doc unset will_msg and cancel the will_message timer
-spec remove_willmsg(Old :: channel()) -> New :: channel().
remove_willmsg(Channel = #channel{timers = Timers}) ->
case maps:get(will_message, Timers, undefined) of
Expand Down

0 comments on commit 26fc157

Please sign in to comment.