rm cli
This commit is contained in:
parent
b539a719a8
commit
95928f6f75
|
@ -29,9 +29,6 @@
|
||||||
-author("Feng Lee <feng@emqtt.io>").
|
-author("Feng Lee <feng@emqtt.io>").
|
||||||
|
|
||||||
-include("emqttd.hrl").
|
-include("emqttd.hrl").
|
||||||
-include("emqttd_cli.hrl").
|
|
||||||
|
|
||||||
-export([cli/1]).
|
|
||||||
|
|
||||||
%% API Function Exports
|
%% API Function Exports
|
||||||
-export([start_link/0]).
|
-export([start_link/0]).
|
||||||
|
@ -71,16 +68,6 @@
|
||||||
sysdescr % Broker description
|
sysdescr % Broker description
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%%%=============================================================================
|
|
||||||
%%% CLI callback
|
|
||||||
%%%=============================================================================
|
|
||||||
cli([]) ->
|
|
||||||
Funs = [sysdescr, version, uptime, datetime],
|
|
||||||
[?PRINT("~-20s~s~n", [Fun, ?MODULE:Fun()]) || Fun <- Funs];
|
|
||||||
|
|
||||||
cli(_) ->
|
|
||||||
?PRINT_CMD("broker", "#query broker version, uptime and description").
|
|
||||||
|
|
||||||
%%%=============================================================================
|
%%%=============================================================================
|
||||||
%%% API
|
%%% API
|
||||||
%%%=============================================================================
|
%%%=============================================================================
|
||||||
|
@ -236,8 +223,6 @@ init([]) ->
|
||||||
% Create $SYS Topics
|
% Create $SYS Topics
|
||||||
emqttd_pubsub:create(<<"$SYS/brokers">>),
|
emqttd_pubsub:create(<<"$SYS/brokers">>),
|
||||||
[ok = create_topic(Topic) || Topic <- ?SYSTOP_BROKERS],
|
[ok = create_topic(Topic) || Topic <- ?SYSTOP_BROKERS],
|
||||||
%% CLI
|
|
||||||
emqttd_ctl:register_cmd(broker, {?MODULE, cli}, []),
|
|
||||||
% Tick
|
% Tick
|
||||||
{ok, #state{started_at = os:timestamp(),
|
{ok, #state{started_at = os:timestamp(),
|
||||||
heartbeat = start_tick(1000, heartbeat),
|
heartbeat = start_tick(1000, heartbeat),
|
||||||
|
@ -295,7 +280,6 @@ handle_info(_Info, State) ->
|
||||||
terminate(_Reason, #state{heartbeat = Hb, tick_tref = TRef}) ->
|
terminate(_Reason, #state{heartbeat = Hb, tick_tref = TRef}) ->
|
||||||
stop_tick(Hb),
|
stop_tick(Hb),
|
||||||
stop_tick(TRef),
|
stop_tick(TRef),
|
||||||
emqttd_ctl:unregister_cmd(broker),
|
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
code_change(_OldVsn, State, _Extra) ->
|
code_change(_OldVsn, State, _Extra) ->
|
||||||
|
|
Loading…
Reference in New Issue