Fix a bug that will not send a will message in some cases

This commit is contained in:
周子博 2018-12-18 12:01:41 +08:00
parent 52e2c56ce1
commit 675edf3fab
1 changed files with 2 additions and 1 deletions

View File

@ -963,7 +963,8 @@ ensure_expire_timer(State) ->
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)};
ensure_will_delay_timer(State) ->
ensure_will_delay_timer(State = #state{will_msg = WillMsg}) ->
send_willmsg(WillMsg),
State.
ensure_stats_timer(State = #state{enable_stats = true, stats_timer = undefined,