delayed will message
This commit is contained in:
parent
cf0f55d057
commit
fb8a86c5e0
|
@ -655,14 +655,14 @@ shutdown(conflict, #pstate{client_id = ClientId}) ->
|
||||||
shutdown(mnesia_conflict, #pstate{client_id = ClientId}) ->
|
shutdown(mnesia_conflict, #pstate{client_id = ClientId}) ->
|
||||||
emqx_cm:unregister_connection(ClientId),
|
emqx_cm:unregister_connection(ClientId),
|
||||||
ignore;
|
ignore;
|
||||||
shutdown(Error, PState = #pstate{connected = Connected,
|
shutdown(Error, PState = #pstate{connected = false}) ->
|
||||||
|
?LOG(info, "Shutdown for ~p", [Error], PState),
|
||||||
|
ignore;
|
||||||
|
shutdown(Error, PState = #pstate{connected = true,
|
||||||
client_id = ClientId,
|
client_id = ClientId,
|
||||||
will_msg = WillMsg}) ->
|
will_msg = WillMsg}) ->
|
||||||
?LOG(info, "Shutdown for ~p", [Error], PState),
|
?LOG(info, "Shutdown for ~p", [Error], PState),
|
||||||
case Connected of
|
send_willmsg(WillMsg),
|
||||||
false -> ok;
|
|
||||||
true -> send_willmsg(WillMsg)
|
|
||||||
end,
|
|
||||||
emqx_hooks:run('client.disconnected', [credentials(PState), Error]),
|
emqx_hooks:run('client.disconnected', [credentials(PState), Error]),
|
||||||
emqx_cm:unregister_connection(ClientId).
|
emqx_cm:unregister_connection(ClientId).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue