From f5defe26389ac50df936e0704b48f3dd4b78de00 Mon Sep 17 00:00:00 2001 From: anlicheng Date: Thu, 15 Jun 2023 12:01:37 +0800 Subject: [PATCH] fix --- apps/iot/src/mocker/host_mocker.erl | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/apps/iot/src/mocker/host_mocker.erl b/apps/iot/src/mocker/host_mocker.erl index d1e12be..3771c1a 100644 --- a/apps/iot/src/mocker/host_mocker.erl +++ b/apps/iot/src/mocker/host_mocker.erl @@ -223,25 +223,17 @@ handle_info({timeout, _, data_ticker}, State = #state{aes = Aes, topic = Topic}) <<"service_name">> => <<"shuibiao">>, <<"at">> => iot_util:timestamp(), <<"fields">> => [ - #{ - <<"used">> => rand:uniform(2048 * 2) - } + #{<<"used">> => rand:uniform(2048 * 2)} ], - <<"tags">> => #{ - - } + <<"tags">> => #{} }, #{ <<"service_name">> => <<"shuibiao:123">>, <<"at">> => iot_util:timestamp(), <<"fields">> => [ - #{ - <<"used">> => rand:uniform(2048 * 2) - } + #{<<"used">> => rand:uniform(2048 * 2)} ], - <<"tags">> => #{ - - } + <<"tags">> => #{} } ], @@ -260,7 +252,7 @@ handle_info({timeout, _, data_ticker}, State = #state{aes = Aes, topic = Topic}) lager:debug("[host_mocker] send data failed, reason: ~p", [Reason]) end, - erlang:start_timer(?TICKER_INTERVAL + 2000 + rand:uniform(5000), self(), data_ticker), + % erlang:start_timer(?TICKER_INTERVAL + 2000 + rand:uniform(5000), self(), data_ticker), {noreply, State}; @@ -300,8 +292,6 @@ handle_info({timeout, _, inform_ticker}, State = #state{aes = Aes, topic = Topic lager:debug("[host_mocker] send inform failed, reason: ~p", [Reason]) end, - erlang:start_timer(?TICKER_INTERVAL + 2000 + rand:uniform(5000), self(), data_ticker), - {noreply, State}; %% 上传微服务的feedback_result信息 @@ -328,8 +318,6 @@ handle_info({timeout, _, feedback_ticker}, State = #state{aes = Aes, topic = Top lager:debug("[host_mocker] send inform failed, reason: ~p", [Reason]) end, - erlang:start_timer(?TICKER_INTERVAL + 2000 + rand:uniform(5000), self(), data_ticker), - {noreply, State}; %% 周期行的ping逻辑