From 0ee5567198c753f98b9ce72cdb2a0a0cb29bf447 Mon Sep 17 00:00:00 2001 From: anlicheng Date: Mon, 28 Aug 2023 16:19:00 +0800 Subject: [PATCH] add config --- apps/iot/src/iot_endpoint.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/iot/src/iot_endpoint.erl b/apps/iot/src/iot_endpoint.erl index 385d9df..d17dcb8 100644 --- a/apps/iot/src/iot_endpoint.erl +++ b/apps/iot/src/iot_endpoint.erl @@ -121,7 +121,7 @@ callback_mode() -> %% 重新加载新的终端配置 handle_event(cast, {reload, NEndpoint}, disconnected, State = #state{endpoint = Endpoint}) -> - lager:warning("[iot_endpoint] state_name: disconnected, reload endpoint, old: ~p, new: ~p", [Endpoint, Endpoint, NEndpoint]), + lager:warning("[iot_endpoint] state_name: disconnected, reload endpoint, old: ~p, new: ~p", [Endpoint, NEndpoint]), {keep_state, State#state{endpoint = NEndpoint}}; handle_event(cast, {reload, NEndpoint = #endpoint{name = Name}}, connected, State = #state{endpoint = Endpoint, timer_map = TimerMap, postman_pid = PostmanPid}) -> @@ -202,7 +202,7 @@ handle_event(info, {timeout, _, {repost_ticker, NorthData = #north_data{id = Id} handle_event(info, {timeout, _, {repost_ticker, _}}, disconnected, State) -> {keep_state, State}; -handle_event(info, {timeout, _, create_postman}, disconnected, State = #state{endpoint = Endpoint = #endpoint{name = Name}, window_size = WindowSize}) -> +handle_event(info, {timeout, _, create_postman}, disconnected, State = #state{endpoint = Endpoint = #endpoint{name = Name, config = Config}, window_size = WindowSize}) -> lager:debug("[iot_endpoint] endpoint: ~p, create postman", [Name]), try {ok, PostmanPid} = create_postman(Endpoint), @@ -210,7 +210,7 @@ handle_event(info, {timeout, _, create_postman}, disconnected, State = #state{en Actions = lists:map(fun(_) -> {next_event, info, fetch_next} end, lists:seq(1, WindowSize)), {next_state, connected, State#state{endpoint = Endpoint, postman_pid = PostmanPid, timer_map = maps:new(), flight_num = 0}, Actions} catch _:Error -> - lager:warning("[iot_endpoint] endpoint: ~p, create postman get error: ~p", [Name, Error]), + lager:warning("[iot_endpoint] endpoint: ~p, config: ~p, create postman get error: ~p", [Name, Config, Error]), erlang:start_timer(?RETRY_INTERVAL, self(), create_postman), {keep_state, State#state{endpoint = Endpoint, postman_pid = undefined}}