From d11c4accca73f5ab93e90d836f7587e5479e4745 Mon Sep 17 00:00:00 2001 From: anlicheng Date: Mon, 24 Jul 2023 11:34:37 +0800 Subject: [PATCH] ver 5 --- apps/iot/src/iot_endpoint.erl | 3 ++- apps/iot/src/iot_endpoint_sup.erl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/iot/src/iot_endpoint.erl b/apps/iot/src/iot_endpoint.erl index 466a903..efef8cc 100644 --- a/apps/iot/src/iot_endpoint.erl +++ b/apps/iot/src/iot_endpoint.erl @@ -261,7 +261,8 @@ create_postman(#endpoint{name = Name, config = Config = #{<<"protocol">> := <<"m {password, as_string(Password)}, {keepalive, Keepalive}, {auto_ack, true}, - {connect_timeout, 5}, + {connect_timeout, 5000}, + {proto_ver, v5}, {retry_interval, RetryInterval} ], diff --git a/apps/iot/src/iot_endpoint_sup.erl b/apps/iot/src/iot_endpoint_sup.erl index 38b790d..9b6aced 100644 --- a/apps/iot/src/iot_endpoint_sup.erl +++ b/apps/iot/src/iot_endpoint_sup.erl @@ -17,7 +17,7 @@ start_link() -> init([]) -> Specs = lists:map(fun child_spec/1, mnesia_endpoint:get_all_endpoints()), - {ok, {#{strategy => one_for_one, intensity => 1000, period => 3600}, []}}. + {ok, {#{strategy => one_for_one, intensity => 1000, period => 3600}, Specs}}. -spec ensured_endpoint_started(Name :: #endpoint{}) -> {ok, Pid :: pid()} | {error, Reason :: any()}. ensured_endpoint_started(Endpoint = #endpoint{}) ->