stop
This commit is contained in:
parent
7ffa25c655
commit
be390d42ac
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
-define(SERVER, ?MODULE).
|
-define(SERVER, ?MODULE).
|
||||||
|
|
||||||
-export([start_link/0]).
|
-export([start_link/0, stop/0]).
|
||||||
|
|
||||||
%% statistics API.
|
%% statistics API.
|
||||||
-export([statsfun/1, statsfun/2,
|
-export([statsfun/1, statsfun/2,
|
||||||
|
@ -88,6 +88,9 @@
|
||||||
start_link() ->
|
start_link() ->
|
||||||
gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
|
gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
|
||||||
|
|
||||||
|
stop() ->
|
||||||
|
gen_server:call(?SERVER, stop).
|
||||||
|
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
%% @doc Generate stats fun
|
%% @doc Generate stats fun
|
||||||
%% @end
|
%% @end
|
||||||
|
@ -149,6 +152,9 @@ init([]) ->
|
||||||
% Tick to publish stats
|
% Tick to publish stats
|
||||||
{ok, #state{tick_tref = emqttd_broker:start_tick(tick)}, hibernate}.
|
{ok, #state{tick_tref = emqttd_broker:start_tick(tick)}, hibernate}.
|
||||||
|
|
||||||
|
handle_call(stop, _From, State) ->
|
||||||
|
{stop, normal, ok, State};
|
||||||
|
|
||||||
handle_call(_Request, _From, State) ->
|
handle_call(_Request, _From, State) ->
|
||||||
{reply, error, State}.
|
{reply, error, State}.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue