From 6b22fb0a0c71ae0386e964715e8f606c2d2baa4c Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Thu, 16 Feb 2017 11:30:43 +0800 Subject: [PATCH] Remove the 'DOWN' client from emqttd_stats --- src/emqttd_cm.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/emqttd_cm.erl b/src/emqttd_cm.erl index 6b40a480f..2e57ebe5b 100644 --- a/src/emqttd_cm.erl +++ b/src/emqttd_cm.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2017 Feng Lee . +%% Copyright (c) 2013-2017 EMQ Enterprise, Inc. (http://emqtt.io) %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -15,10 +15,13 @@ %%-------------------------------------------------------------------- %% @doc MQTT Client Manager + -module(emqttd_cm). -behaviour(gen_server2). +-author("Feng Lee "). + -include("emqttd.hrl"). -include("emqttd_internal.hrl"). @@ -120,6 +123,7 @@ handle_info({'DOWN', MRef, process, DownPid, _Reason}, State) -> {ok, {ClientId, DownPid}} -> case lookup_proc(ClientId) of DownPid -> + emqttd_stats:del_client_stats(ClientId), ets:delete(mqtt_client, ClientId); _ -> ignore