Fix a bug that will not send a will message in some cases (#2068)

* Fix a bug that will not send a will message in some cases
This commit is contained in:
tigercl 2018-12-18 14:55:37 +08:00 committed by turtleDeng
parent b7a39f25f2
commit 95ad67b47c
1 changed files with 3 additions and 2 deletions

View File

@ -963,8 +963,9 @@ ensure_expire_timer(State) ->
ensure_will_delay_timer(State = #state{will_msg = #message{headers = #{'Will-Delay-Interval' := WillDelayInterval}}}) -> ensure_will_delay_timer(State = #state{will_msg = #message{headers = #{'Will-Delay-Interval' := WillDelayInterval}}}) ->
State#state{will_delay_timer = emqx_misc:start_timer(WillDelayInterval * 1000, will_delay)}; State#state{will_delay_timer = emqx_misc:start_timer(WillDelayInterval * 1000, will_delay)};
ensure_will_delay_timer(State) -> ensure_will_delay_timer(State = #state{will_msg = WillMsg}) ->
State. send_willmsg(WillMsg),
State#state{will_msg = undefined}.
ensure_stats_timer(State = #state{enable_stats = true, stats_timer = undefined, ensure_stats_timer(State = #state{enable_stats = true, stats_timer = undefined,
idle_timeout = IdleTimeout}) -> idle_timeout = IdleTimeout}) ->