This commit is contained in:
anlicheng 2023-06-15 13:06:45 +08:00
parent b5717b1f78
commit b68e1489dd

View File

@ -102,7 +102,7 @@ make_assoc(Pid) when is_pid(Pid) ->
%% , true false表示关闭激活
-spec activate(Pid :: pid(), Auth :: boolean()) -> ok.
activate(Pid, Auth) when is_pid(Pid), is_binary(Auth) ->
activate(Pid, Auth) when is_pid(Pid), is_boolean(Auth) ->
gen_server:call(Pid, {activate, Auth}).
-spec get_metric(Pid :: pid()) -> {ok, MetricInfo :: map()}.
@ -152,8 +152,10 @@ init([UUID]) ->
{noreply, NewState :: #state{}, timeout() | hibernate} |
{stop, Reason :: term(), Reply :: term(), NewState :: #state{}} |
{stop, Reason :: term(), NewState :: #state{}}).
handle_call(get_metric, _From, State = #state{metrics = Metrics}) ->
handle_call(get_metric, _From, State = #state{metrics = Metrics, has_session = true}) ->
{reply, {ok, Metrics}, State};
handle_call(get_metric, _From, State) ->
{reply, {ok, #{}}, State};
handle_call(get_aes, _From, State = #state{aes = Aes}) ->
{reply, {ok, Aes}, State};